php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49213 Apostrophe problem with e modifiers
Submitted: 2009-08-10 17:32 UTC Modified: 2009-08-10 18:56 UTC
From: SiMM at none dot box Assigned:
Status: Not a bug Package: PCRE related
PHP Version: 5.3.0 OS: Windows XP
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: SiMM at none dot box
New email:
PHP Version: OS:

 

 [2009-08-10 17:32 UTC] SiMM at none dot box
Description:
------------
When using the modifier e and the availability of input parameter apostrophe occurs adding slash

Reproduce code:
---------------
echo preg_replace('#.#e','"$0"',"'");

Expected result:
----------------
'

Actual result:
--------------
\'

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-08-10 18:56 UTC] jani@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

RTFM:

http://www.php.net/manual/en/function.preg-replace.php

"When using the e modifier, this function escapes some characters 
(namely ', ", \ and NULL) in the strings that replace the 
backreferences"
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 15 09:01:28 2025 UTC