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