浏览代码

Another array detection "if" statement.

Tyler Akins 24 年之前
父节点
当前提交
94dd6b5127
共有 1 个文件被更改,包括 8 次插入5 次删除
  1. 8 5
      functions/imap_general.php

+ 8 - 5
functions/imap_general.php

@@ -17,11 +17,11 @@
       global $color, $squirrelmail_language, $imap_general_debug;
       global $color, $squirrelmail_language, $imap_general_debug;
 
 
       $counter = 0;
       $counter = 0;
-	  do {
+      do {
           $data[$counter] = $read = fgets ($imap_stream, 4096);
           $data[$counter] = $read = fgets ($imap_stream, 4096);
           if ($imap_general_debug) { echo "<small><tt><font color=cc0000>$read</font></tt></small><br>"; flush(); }
           if ($imap_general_debug) { echo "<small><tt><font color=cc0000>$read</font></tt></small><br>"; flush(); }
           $counter++;
           $counter++;
-	  } while (! ereg("^$pre (OK|BAD|NO)(.*)$", $read, $regs));
+      } while (! ereg("^$pre (OK|BAD|NO)(.*)$", $read, $regs));
 
 
       $response = $regs[1];
       $response = $regs[1];
       $message = trim($regs[2]);
       $message = trim($regs[2]);
@@ -89,9 +89,12 @@
                    printf (_("Unknown error: %s") . "<br>\n", $message);
                    printf (_("Unknown error: %s") . "<br>\n", $message);
                echo "<br>";
                echo "<br>";
                echo _("Read data:") . "<br>\n";
                echo _("Read data:") . "<br>\n";
-               foreach ($read as $line)
-               {
-                   echo htmlspecialchars($line) . "<br>\n";
+	       if (is_array($read))
+	       {
+                   foreach ($read as $line)
+                   {
+                       echo htmlspecialchars($line) . "<br>\n";
+		   }
                }
                }
                exit;
                exit;
             } else {
             } else {