Bug #67986 [NEW]: preg函数处理utf8中文

From: Date: Tue, 09 Sep 2014 06:38:23 +0000
Subject: Bug #67986 [NEW]: preg函数处理utf8中文
Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-12264@lists.php.net to get a copy of this message
From: pz9042 at 163 dot com Operating system: win PHP version: 5.4.32 Package: PECL Bug Type: Bug Bug description:preg函数处理utf8中文 Description: ------------ 在一用preg_match或者preg_match_all 或者preg_replace处理一段utf8编码的中文时,谷歌浏览器报与localhost的连接中断,火狐则跳转到www.localhost.com页面,经排查,讲字符转成ansi编码,就不会出现问题,且在win下cli下,也不会错误,只有用浏览器会出现此问题,web服务器是apache,不管是浏览器还是cli,php的配置文件是同一个 Test script: --------------- header("Content-type: text/html; charset=utf-8"); ini_set('pcre.backtrack_limit', '-1'); ini_set('pcre.recursion_limit', '-1'); $source = '<p>用户注册须具有法定的相应权利能力和行为能力的自然人、法人或其他组织,能够独立承担法律责任。您完成注册程序或其他十色网平台同意的方式实际使用本平台服务时,即视为您确认自己具备主体资格,能够独立承担法律责任。若因您不具备主体资格,而导致的一切后果,由您及您的监护人自行承担。</p>'; preg_match( "/([^a-zA-Z0-9_]{1,1})+(copy|fputs|fopen|file_put_contents|fwrite|eval|phpinfo)+/is" ,$source ,$match ); print_r($match);exit; -- Edit bug report at https://bugs.php.net/bug.php?id=67986&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=67986&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=67986&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=67986&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=67986&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=67986&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=67986&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=67986&r=needscript Try newer version: https://bugs.php.net/fix.php?id=67986&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=67986&r=support Expected behavior: https://bugs.php.net/fix.php?id=67986&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=67986&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=67986&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=67986&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=67986&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=67986&r=dst IIS Stability: https://bugs.php.net/fix.php?id=67986&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=67986&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=67986&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=67986&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=67986&r=mysqlcfg

« previous php.pecl.dev (#12264) next »