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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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 27 04:01:31 2024 UTC