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


-- 
PECL development discussion Mailing List (http://pecl.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to