Fix quote_imap, the ereg pattern wasn't always interpreted right
[squirrelmail.git] / 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);
 }
 
 /**