php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34119 mb_ereg chokes on \x80-\xF7
Submitted: 2005-08-13 13:12 UTC Modified: 2006-02-17 00:22 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: ondrej at sury dot org Assigned: hirokawa (profile)
Status: Closed Package: mbstring related
PHP Version: 4.4.0 OS: Linux
Private report: No CVE-ID: None
 [2005-08-13 13:12 UTC] ondrej at sury dot org
Description:
------------
mb_ereg prints invalid regular expression error on certain characters.

This is fixed in php 5.0.4.

More information could be found at:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=278044

Reproduce code:
---------------
$name = "user/1/viewuser/1/edit";
if (mb_ereg("[^\x80-\xF7 [:alnum:]@_.-]", $name)) print('The username contains an illegal character.');

Expected result:
----------------
The username contains an illegal character.

Actual result:
--------------
Warning: mb_ereg(): mbregex compile err: invalid regular expression in /var/www/mb_ereg.php on line 4


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-13 20:29 UTC] sniper@php.net
Moriyoshi, I guess you need to backport something..?
 [2005-12-24 02:32 UTC] sniper@php.net
Rui, check this out please.
 [2005-12-24 06:20 UTC] hirokawa@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

It works fine for me.
Please check it by CVS snapshot of PHP 4.4.

Code:
<?php
$name = "user/1/viewuser/1/edit";
if (ereg("[^\x80-\xF7 [:alnum:]@_.-]", $name)) {
  print "The username contains an illegal character.\n";
 } else {
  print "ok.\n";
 }
?>

Result in PHP 4.4.2RC2-dev (Linux FedoraCore4):
 The username contains an illegal character.

 [2006-01-01 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2006-02-17 00:22 UTC] hirokawa@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 09:01:29 2024 UTC