From: kink Date: Tue, 23 Mar 2004 10:39:24 +0000 (+0000) Subject: Fix quote_imap, the ereg pattern wasn't always interpreted right X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=ab1df059d97dc80d52a7f932a7b431e558197844 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. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@6849 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/strings.php b/functions/strings.php index e295c4c9..4ff54b89 100644 --- a/functions/strings.php +++ b/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); } /**