ID:               41499
 Updated by:       [EMAIL PROTECTED]
 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&#65533;test


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=41499&edit=1

Reply via email to