From: henrique at webcoder dot com dot br
Operating system: Debian Etch
PHP version: 4.4.7
PHP Bug Type: Feature/Change Request
Bug description: ereg with null
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 bug report at http://bugs.php.net/?id=41499&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=41499&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=41499&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=41499&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41499&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=41499&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=41499&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=41499&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=41499&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=41499&r=support
Expected behavior: http://bugs.php.net/fix.php?id=41499&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=41499&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=41499&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41499&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41499&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41499&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=41499&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=41499&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=41499&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=41499&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=41499&r=mysqlcfg