php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50256 preg_replace with e modifier quotes parsing
Submitted: 2009-11-21 11:03 UTC Modified: 2009-11-21 14:59 UTC
From: janturon at email dot cz Assigned:
Status: Not a bug Package: PCRE related
PHP Version: 5.3.1 OS: Win 2000
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: janturon at email dot cz
New email:
PHP Version: OS:

 

 [2009-11-21 11:03 UTC] janturon at email dot cz
Description:
------------
preg_replace with e modifier handles quotes bad
(might be related to bug #32985)

Reproduce code:
---------------
function func($str) { return '"'.$str.'"'; }
echo preg_replace("/(.*)/e","func('\\1')","foo");


Expected result:
----------------
"foo"


Actual result:
--------------
"foo"""

In PHP 5.2.9 (Win XP), this result was produced (bug #32985)
\"foo\"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-11-21 14:59 UTC] jani@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

Please search the bug database before you submit yet another bogus 
report.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 06 10:01:31 2024 UTC