#15050 [Com]: preg_replace backslashes " or ' character
| From: | php at derailer dot org | Date: | Wed, 31 Mar 2004 16:32:37 +0000 |
| Subject: | #15050 [Com]: preg_replace backslashes " or ' character | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-57234@lists.php.net to get a copy of this message | ||
ID: 15050
Comment by: php at derailer dot org
Reported By: joyeux at 1984 dot cz
Status: Bogus
Bug Type: PCRE related
Operating System: MDK Linux
PHP Version: 4.1.0
New Comment:
This still occurs for me, but only with double quotes. I turned off
every magic_quotes_* directive in php.ini just to be sure, and it still
happens, just as described here. Single quotes, and literal backslashes
*are not affected* for me at all.
PHP 4.3.5, BTW.
Previous Comments:
------------------------------------------------------------------------
[2002-01-15 10:59:38] sander@php.net
Not a bug. RTM on Magic Quotes.
------------------------------------------------------------------------
[2002-01-15 10:07:48] joyeux at 1984 dot cz
<?
$text=' something and one " ';
echo("$text\n");
$text=preg_replace("/(.*)/e","'\\1'",$text);
echo($text);
?>
output:
something and one "
something and one \"
- in executable mode preg_replace adds a backslash. Why?
I think it shouldn't do anything with.
- it's the same when I use ' instead ", but switched.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=15050&edit=1