rewrote unfold routine inside sqimap_small_header_list because it didn't
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 24 Feb 2003 20:36:51 +0000 (20:36 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 24 Feb 2003 20:36:51 +0000 (20:36 +0000)
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

functions/imap_messages.php

index b71d8d25cb43004ece5bb1b587553b139aebc159..3cf506b8f0f182fdd9eb81328603ff64f57ac199 100755 (executable)
@@ -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;