Fix quote_imap, the ereg pattern wasn't always interpreted right
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 23 Mar 2004 10:39:24 +0000 (10:39 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 23 Mar 2004 10:39:24 +0000 (10:39 +0000)
due to the escaping of backslashes. I've replaced it with the
faster preg_replace and used double quotes to lessen the escaping
confusion.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@6849 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/strings.php

index e295c4c910581e81d4f37e7384ebfed934bccb33..4ff54b898bfeb95e145ed5deb259da559bf41aa0 100644 (file)
@@ -458,7 +458,7 @@ function GenerateRandomString($size, $chars, $flags = 0) {
  * @return string the escaped string
  */
 function quoteimap($str) {
-    return ereg_replace('(["\\])', '\\\\1', $str);
+    return preg_replace("/([\"\\\\])/", "\\\\$1", $str);
 }
 
 /**