#45438 [NEW]: mb_eregi finds space

From: Date: Sun, 06 Jul 2008 10:17:14 +0000
Subject: #45438 [NEW]: mb_eregi finds space
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-126306@lists.php.net to get a copy of this message
From: hayk at mail dot ru Operating system: CentOS 5.1 (x64) PHP version: 5.2.6 PHP Bug Type: mbstring related Bug description: mb_eregi finds space Description: ------------ Sometimes mb_eregi finds space in the string when string in utf-8 and contains Russian capitalized "&#1056;" (chr(0xD0) . chr(0xA0) in utf-8, it's not English "P"). Reproduce code: --------------- <?php mb_internal_encoding('UTF-8'); header('Content-Type: text/html; charset=utf-8'); $x = '&#1055;&#1056;&#1048;&#1056;&#1054;&#1044;&#1040;'; //$x = chr(0xD0) . chr(0x9F) . chr(0xD0) . chr(0xA0) . chr(0xD0) . chr(0x98) . chr(0xD0) . chr(0xA0) . chr(0xD0) . chr(0x9E) . chr(0xD0) . chr(0x94) . chr(0xD0) . chr(0x90); $r = mb_eregi('^([^[:space:]]+([[:space:]][ivx]+)?)(.*)$', $x, $m); print_r($m); ?> Expected result: ---------------- Array ( [0] => &#1087;&#1088;&#1080;&#1088;&#1086;&#1076;&#1072; [1] => &#1087;&#1088;&#1080;&#1088;&#1086;&#1076;&#1072; [2] => [3] => ) Actual result: -------------- Array ( [0] => &#1055;&#1056;&#1048;&#1056;&#1054;&#1044;&#1040; [1] => &#1055;&#65533; [2] => [3] => &#65533;&#1048;&#1056;&#1054;&#1044;&#1040; ) -- Edit bug report at http://bugs.php.net/?id=45438&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45438&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45438&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45438&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=45438&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=45438&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=45438&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=45438&r=needscript Try newer version: http://bugs.php.net/fix.php?id=45438&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=45438&r=support Expected behavior: http://bugs.php.net/fix.php?id=45438&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=45438&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=45438&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=45438&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45438&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=45438&r=dst IIS Stability: http://bugs.php.net/fix.php?id=45438&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=45438&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=45438&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=45438&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=45438&r=mysqlcfg

« previous php.bugs (#126306) next »