PHP 5.3.3 bug or preg_match bad validate?
<?php
$query = 'q=Riha47444444444444444444444444444444444444444444444444444444444444a47444444444444444444444444444444444444444444444444444444444444a47444444444444444444444444444444444444444444444444444444444444a47444444444444444444444444444444444444444444444444444444444444a47444444444444444444444444444444444444444444444444444444444444a47444444444444444444444444444444444444444444444444444444444444a47444444444444444444444444444444444444444444444444444444444444a47444444444444444444444444444444444444444444444444444444444444a47444444444444444444444444444444444444444444444444444444444444a4744444444444444444444444444444444444444444444444na&start-index=60&max-results=20';
$pattern = "/^(?:%[[:xdigit:]]{2}|[A-Za-z0-9-_.!~*'()\[\];\/?:@&=+$,])*$/";
if (preg_match($p开发者_如何学Pythonattern, $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?
$query = 'q=Riha47444444444444444444444444444444444444444444444444444444444444a47444444444444444444444444444444444444444444444444444444444444a47444444444444444444444444444444444444444444444444444444444444a47444444444444444444444444444444444444444444444444444444444444a47444444444444444444444444444444444444444444444444444444444444a47444444444444444444444444444444444444444444444444444444444444a47444444444444444444444444444444444444444444444444444444444444a47444444444444444444444444444444444444444444444444444444444444a47444444444444444444444444444444444444444444444444444444444444a4744444444444444444444444444444444444444444444444na&start-index=60&max-results=20';
if (preg_match('#^(?:%[[:xdigit:]]{2}|[A-Za-z0-9-_.!~*\'()[\];/?:@&=+$,])*$#i', $query)) {
echo "TRUE"; // THIS CASE
} else {
echo "FALSE"
}
精彩评论