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
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.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 19:01:29 2024 UTC