php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67986 preg函数处理utf8中文
Submitted: 2014-09-09 06:38 UTC Modified: 2014-10-24 23:09 UTC
From: pz9042 at 163 dot com Assigned:
Status: No Feedback Package: PECL (PECL)
PHP Version: 5.4.32 OS: win
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: pz9042 at 163 dot com
New email:
PHP Version: OS:

 

 [2014-09-09 06:38 UTC] pz9042 at 163 dot com
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;


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-09-09 08:26 UTC] tony2001@php.net
-Status: Open +Status: Feedback
 [2014-09-09 08:26 UTC] tony2001@php.net
Sorry, only half of the world speaks Chinese these days, the other half mostly uses English.
Try reporting the same in English, pls.
 [2014-10-24 23:09 UTC] ab@php.net
-Status: Feedback +Status: No Feedback
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 00:01:29 2024 UTC