#32985 [NEW]: /e Modifier Escaping Double Quotes With \ Even Though Magic Quotes Is Off

From: Date: Mon, 09 May 2005 13:32:01 +0000
Subject: #32985 [NEW]: /e Modifier Escaping Double Quotes With \ Even Though Magic Quotes Is Off
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-78808@lists.php.net to get a copy of this message
From: crypticcreeper at yahoo dot com Operating system: Linux & Windows PHP version: 5.0.4 PHP Bug Type: PCRE related Bug description: /e Modifier Escaping Double Quotes With \ Even Though Magic Quotes Is Off Description: ------------ When using the /e modifier if the match contains a double quote it is escaped with a \ If it was magic quotes I am assuming it would effect single quotes too, but in fact doesnt. I tested this on Windows 2000 5.0.5-dev and on Linux 5.0.4 and both had same results. Even when I test using a conditional to see if magic quotes is on it still runs it. I even manually set magic quotes off in the script and still the problem occurred. I'm not sure if this is documented behavior, I do know /e causes PHP to escape data, but why only double quotes? Reproduce code: --------------- $data = ' " ' $data = preg_replace('/(")/ie', "'$1'", $data); echo $data; Expected result: ---------------- " Actual result: -------------- \" -- Edit bug report at http://bugs.php.net/?id=32985&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32985&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32985&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32985&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=32985&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=32985&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=32985&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=32985&r=needscript Try newer version: http://bugs.php.net/fix.php?id=32985&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=32985&r=support Expected behavior: http://bugs.php.net/fix.php?id=32985&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=32985&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=32985&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=32985&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32985&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=32985&r=dst IIS Stability: http://bugs.php.net/fix.php?id=32985&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=32985&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=32985&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=32985&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=32985&r=mysqlcfg

« previous php.bugs (#78808) next »