PHP 5.3.3 bug 或 preg_match 验证错误?
<?php
$query = 'q=Riha47444444444444444444444444444444444444444444444444444444444444a47444444444444444444444444444444444444444444444444444444444444a47444444444444444444444444444444444444444444444444444444444444a47444444444444444444444444444444444444444444444444444444444444a47444444444444444444444444444444444444444444444444444444444444a47444444444444444444444444444444444444444444444444444444444444a47444444444444444444444444444444444444444444444444444444444444a47444444444444444444444444444444444444444444444444444444444444a47444444444444444444444444444444444444444444444444444444444444a4744444444444444444444444444444444444444444444444na&start-index=60&max-results=20';
$pattern = "/^(?:%[[:xdigit:]]{2}|[A-Za-z0-9-_.!~*'()\[\];\/?:@&=+$,])*$/";
if (preg_match($pattern, $query))
echo 'true';
else
echo 'false';
该脚本没有任何输出...它提供下载 php 文件 0 字节.. 我需要修复它,因为它可能仍然是 Zend_Gdata 中的一个错误!抱歉英语不好。
编辑:
你有 5.3.3 版本的 php? 如果在表达式末尾添加“U”,问题就会消失。 搞什么鬼?
<?php
$query = 'q=Riha47444444444444444444444444444444444444444444444444444444444444a47444444444444444444444444444444444444444444444444444444444444a47444444444444444444444444444444444444444444444444444444444444a47444444444444444444444444444444444444444444444444444444444444a47444444444444444444444444444444444444444444444444444444444444a47444444444444444444444444444444444444444444444444444444444444a47444444444444444444444444444444444444444444444444444444444444a47444444444444444444444444444444444444444444444444444444444444a47444444444444444444444444444444444444444444444444444444444444a4744444444444444444444444444444444444444444444444na&start-index=60&max-results=20';
$pattern = "/^(?:%[[:xdigit:]]{2}|[A-Za-z0-9-_.!~*'()\[\];\/?:@&=+$,])*$/";
if (preg_match($pattern, $query))
echo 'true';
else
echo 'false';
The script has nothing as the output... It offers to download php file 0 bytes..
I need to fix it because it's probably still a bug in Zend_Gdata! Sorry for bad english.
EDIT:
You have a 5.3.3 version of php?
The problem disappears if you add a "U" at the end of the expression.
What the f*ck?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)