added phpdoc blocks.
[squirrelmail.git] / plugins / mail_fetch / fetch.php
index 03c9211b52b7f9ea6333999c98ada8651301463a..39e0d1df79043996426445c265aa2468ea59c68e 100644 (file)
@@ -3,14 +3,17 @@
 /**
  * mail_fetch/fetch.php
  *
- * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Copyright (c) 1999-2004 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  * Fetch code.
  *
  * $Id$
+ * @package plugins
+ * @subpackage mail_fetch
  */
 
+/** @ignore */
 define('SM_PATH','../../');
 
 require_once(SM_PATH . 'include/validate.php');
@@ -225,7 +228,9 @@ sqgetGlobalVar('delimiter',  $delimiter,  SQ_SESSION);
 
         for (; $i <= $Count; $i++) {
             Mail_Fetch_Status(_("Fetching message ") . "$i" );
-            set_time_limit(20); // 20 seconds per message max
+
+            if (!ini_get('safe_mode'))
+                set_time_limit(20); // 20 seconds per message max
             $Message = '';
             $MessArray = $pop3->get($i);
 
@@ -265,8 +270,10 @@ sqgetGlobalVar('delimiter',  $delimiter,  SQ_SESSION);
                 fputs($imap_stream, $Message);
                 fputs($imap_stream, "\r\n");
                 sqimap_read_data($imap_stream, "A3$i", false, $response, $message);
+               $response=(implode('',$response));
+               $message=(implode('',$message));
                 if ($response != 'OK') {
-                    Mail_Fetch_Status(_("Error Appending Message!")." ".$message );
+                    Mail_Fetch_Status(_("Error Appending Message!")." ".htmlspecialchars($message) );
                     Mail_Fetch_Status(_("Closing POP"));
                     $pop3->quit();
                     Mail_Fetch_Status(_("Logging out from IMAP"));