From fec4f414760ce3416a6513d002fdac19d2446cd9 Mon Sep 17 00:00:00 2001 From: stekkel Date: Wed, 11 Jun 2003 17:09:15 +0000 Subject: [PATCH] performance tweak git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4994 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/mime.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/functions/mime.php b/functions/mime.php index 51d84b24..57ab2981 100644 --- a/functions/mime.php +++ b/functions/mime.php @@ -574,6 +574,7 @@ function decodeHeader ($string, $utfencode=true,$htmlsave=true) { $encoded = false; /* if encoded words are not separated by a linear-space-white we still catch them */ $j = $i-1; + if ($chunk{0} === '=') { /* performance, saves an unnessecarry preg call */ while ($match = preg_match('/^(.*)=\?([^?]*)\?(Q|B)\?([^?]*)\?=(.*)$/Ui',$chunk,$res)) { /* if the last chunk isn't an encoded string then put back the space, otherwise don't */ if ($iLastMatch !== $j) { @@ -615,6 +616,7 @@ function decodeHeader ($string, $utfencode=true,$htmlsave=true) { $chunk = $res[5]; $encoded = true; } + } if (!$encoded) { if ($htmlsave) { $ret .= ' '; -- 2.25.1