Explorar o código

Fix quote_imap, the ereg pattern wasn't always interpreted right
due to the escaping of backslashes. I've replaced it with the
faster preg_replace and used double quotes to lessen the escaping
confusion.

Thijs Kinkhorst %!s(int64=21) %!d(string=hai) anos
pai
achega
67b3f9cb87
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      functions/strings.php

+ 1 - 1
functions/strings.php

@@ -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);
 }
 
 /**