|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12042 $ can't be escaped when using ereg function
Submitted: 2001-07-11 05:46 UTC Modified: 2001-07-11 05:51 UTC
From: teocl at globalsources dot com Assigned:
Status: Not a bug Package: *Regular Expressions
PHP Version: 4.0.6 OS: LINUX
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: teocl at globalsources dot com
New email:
PHP Version: OS:


 [2001-07-11 05:46 UTC] teocl at globalsources dot com
Please see the codes below:

$arrfile = '<?include("$DOCUMENT_ROOT/TEMPLATES/TOP-BANNER.HTM");?>';

        print "good\n";
        print "bad\n";


The result will return "bad" because the eregi can't find the expression in the $arrfile. If I removed the $, it will return "good". I guess "$" can't be escaped inside the eregi function. Please help.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-11 05:51 UTC]
This is known and expected behavior.  Please review the regex docs more carefully - also search the php-general mailing list archives.

The quick fix is to place 3 backslashes in front of the $.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 15 11:01:30 2024 UTC