#34560 [NEW]: preg_replace strips double backslashes from second argument
| From: | astax dot t at gmail dot com | Date: | Tue, 20 Sep 2005 10:53:51 +0000 |
| Subject: | #34560 [NEW]: preg_replace strips double backslashes from second argument | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-85269@lists.php.net to get a copy of this message | ||
From: astax dot t at gmail dot com
Operating system: Debian
PHP version: 4.4.0
PHP Bug Type: PCRE related
Bug description: preg_replace strips double backslashes from second argument
Description:
------------
preg_replace strips double backslashes from the second passed argument,
but keeps all other backslashes
Reproduce code:
---------------
$var = "a\\\\b\\c\\\""; # this is a string a\\b\c\"
$subj = "this is a {sample} text";
echo preg_replace("/\{sample\}/", $var, $subj);
Expected result:
----------------
this is a a\\b\c\" text
Actual result:
--------------
this is a a\b\c\" text
--
Edit bug report at http://bugs.php.net/?id=34560&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34560&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34560&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34560&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=34560&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=34560&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=34560&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=34560&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=34560&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=34560&r=support
Expected behavior: http://bugs.php.net/fix.php?id=34560&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=34560&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=34560&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=34560&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34560&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=34560&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=34560&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=34560&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=34560&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=34560&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=34560&r=mysqlcfg