php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25849 regular expression on a UTF-8 string brakes this string
Submitted: 2003-10-13 07:02 UTC Modified: 2003-10-13 07:11 UTC
From: troublegum at woltlab dot de Assigned:
Status: Not a bug Package: PCRE related
PHP Version: 4CVS-2003-10-13 (stable) OS: Windows 2000 Pro SP4
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: troublegum at woltlab dot de
New email:
PHP Version: OS:

 

 [2003-10-13 07:02 UTC] troublegum at woltlab dot de
Description:
------------
I want to perform a regular expression on a string to replace all
whitespace and commas with one single space. 
But If the string is a UTF-8 string, this string will be broken.

I was not able to reproduce this behavior on my DebianLinux/Apache1.3.28/PHP4.3.3 Server.
It occurs only on my Windows 2000 machine.

Server: Apache 1.3.28
PHP as Apache Module

php.ini Settings that diff from php.ini-dist:
display_startup_errors = On
magic_quotes_gpc = Off
doc_root = c:/dev/htdocs
extension_dir = c:/dev/php-4.3.3dev/extensions/
upload_max_filesize = 6M
extension=php_bz2.dll
extension=php_gd2.dll
extension=php_gettext.dll
extension=php_mbstring.dll
extension=php_pdf.dll
extension=php_sockets.dll
session.save_path = c:/winnt/temp/php4_sessions
session.use_trans_sid = 1

Reproduce code:
---------------
see http://webpm.woltlab.info/phpgroup/pcre_utf8.phps

Please read also the comments on the regular expression
I can provide more strings that will fail if it is necessary.

Expected result:
----------------
1) Coeur    D?j?   Pris
2) Coeur D?j? Pris

Actual result:
--------------
1) Coeur    D?j?   Pris
2) Coeur D?j? Pris

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 15:01:28 2024 UTC