فهرست منبع

fix for never ending while loop

stekkel 23 سال پیش
والد
کامیت
9970784525
1فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 3 3
      functions/imap_messages.php

+ 3 - 3
functions/imap_messages.php

@@ -492,9 +492,9 @@ function sqimap_get_small_header_list ($imap_stream, $msg_list) {
 
         foreach ($read as $read_part) {
             //unfold multi-line headers
-            while ($prevline && strspn($read_part, "\t ") > 0) {
-               $read_part = substr($prevline, 0, -2) . ' ' . ltrim($read_part);
-            }
+	    if ($prevline && strpos($read_part, "\t ") === true) {
+	        $read_part = substr($prevline, 0, -2) . preg_replace('/(\t\s+)/',' ',$read_part);
+	    }
             $prevline = $read_part;
             if ($read_part{0} == '*') {
                 if ($internaldate) {