From: stekkel Date: Mon, 24 Feb 2003 20:36:51 +0000 (+0000) Subject: rewrote unfold routine inside sqimap_small_header_list because it didn't X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b983b18ea77bf416d0e16253acd1408e3112358c;p=squirrelmail.git rewrote unfold routine inside sqimap_small_header_list because it didn't handle the headerlines like it should (rfc2060). For example a subject line with a subject size of 70 chars (no spaces) could not be detected. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4551 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/imap_messages.php b/functions/imap_messages.php index b71d8d25..3cf506b8 100755 --- a/functions/imap_messages.php +++ b/functions/imap_messages.php @@ -517,7 +517,8 @@ function sqimap_get_small_header_list ($imap_stream, $msg_list) { foreach ($read as $read_part) { //unfold multi-line headers - if ($prevline && strpos($read_part, "\t ") === true) { + if ($prevline && $prevline{strlen($prevline)-1} == "\n" + && ($read_part{0} == ' ' || $read_part{0} == "\t")) { $read_part = substr($prevline, 0, -2) . preg_replace('/(\t\s+)/',' ',$read_part); } $prevline = $read_part;