#41499 [Opn->Bgs]: ereg with null
| From: | johannes@php.net | Date: | Fri, 25 May 2007 16:16:15 +0000 |
| Subject: | #41499 [Opn->Bgs]: ereg with null | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-113024@lists.php.net to get a copy of this message | ||
ID: 41499
Updated by: johannes@php.net
Reported By: henrique at webcoder dot com dot br
-Status: Open
+Status: Bogus
Bug Type: Feature/Change Request
Operating System: Debian Etch
PHP Version: 4.4.7
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
"Warning
These regular expression functions are not binary-safe. The PCRE
functions are. "
http://php.net/regex
Previous Comments:
------------------------------------------------------------------------
[2007-05-25 14:23:55] henrique at webcoder dot com dot br
Description:
------------
Hi!
Value %00 in the end of the regular expression is sent and the function
ereg() disrespects the remaining portion all.
Tested in the PHP 4.4.4-8+etch1
Thank you!
Henrique
Reproduce code:
---------------
function validateGender($gender)
{
return (ereg("^[MF]$", $gender)) ? $gender : false;
}
print "Gender: ". validateGender($_GET['gender']);
Expected result:
----------------
?gender=M%00<b>test</b>
Gender:
Actual result:
--------------
?gender=M%00<b>test</b>
Gender:M�test
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41499&edit=1