Don't use regular expressions when you don't need to
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 4 Mar 2011 01:19:33 +0000 (01:19 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 4 Mar 2011 01:19:33 +0000 (01:19 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@14090 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/strings.php

index fcc61b92db4eee298c8a5331a225bf9b662c1296..08f1930c081c61fc3985194999fe87031c2921a9 100644 (file)
@@ -731,7 +731,7 @@ function GenerateRandomString($size, $chars, $flags = 0) {
  * @since 1.0.3
  */
 function quoteimap($str) {
-    return preg_replace("/([\"\\\\])/", "\\\\$1", $str);
+    return str_replace(array('\\', '"'), array('\\\\', '\\"'), $str);
 }
 
 /**