|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11487 eregi DO NOT FIND expression if string too complicated and from $fcontents
Submitted: 2001-06-14 09:47 UTC Modified: 2002-06-16 08:17 UTC
From: dbucher at horus dot ch Assigned:
Status: Not a bug Package: Regexps related
PHP Version: 3.0.17 OS: Linux Debian
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:
Bug Type:
From: dbucher at horus dot ch
New email:
PHP Version: OS:


 [2001-06-14 09:47 UTC] dbucher at horus dot ch
In some cases, eregi_replace doesn't work. I found it didn't worked
when reading the a long/complicated line from a file :

1. I read $line from a file and $line becomes :

"<tr><td>PPM</td><td>GrandBento</td><td>hi</td><td>3128</td><td>def</td><td>def</td><td><a href=\"PHP_url_me?req_modmain=showprod&req_modsub=view&req_id=1\">[view]</a> <a href=\"PHP_url_me?req_modmain=showprod&req_modsub=edit&req_id=1\">[edit]</a> [del]</td></tr>"

2. $url_myself = "";
   and $line = eregi_replace ("PHP_url_me", $url_myself, $line);

   doesn't work !

3. For the other lines from the same file (shorter and with less
   special characters) it WORKS !

   AND that line is not tested the same as if I do
   $line2 = ...
   ($line <> $line2) ?!

4. in eregi_replace ($pattern, $replace, $string), are there special characters into $string ???? and even, why the same $line is not the same when read from a file


I suppose the bug is more in $fcontents than ereg, BUT WHY ereg
doesn't find a pattern which IS INTO the string ($line) ?
Whatever the line can be, the pattern is there, so why doesn't
it find it ?

I suppose you don't need any other information, but just in case :
 - Debian Linux potato
 - PHP 3.0.18



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-16 08:17 UTC]
Thank you for taking the time to report a problem with PHP.
Unfortunately, PHP 3 is no longer supported. Please download
the latest version of PHP 4 from

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Dec 04 04:01:27 2023 UTC