Undo my stupidity
[squirrelmail.git] / functions / imap_messages.php
index b271674a0e9000cfa4578ccc3dea1a28108e3a7d..583b5537702e9c21f6ab57da7bb1d809939f5f31 100755 (executable)
@@ -9,8 +9,9 @@
  * This implements functions that manipulate messages
  * NOTE: Quite a few functions in this file are obsolete
  *
- * $Id$
+ * @version $Id$
  * @package squirrelmail
+ * @subpackage imap
  */
 
 /**
@@ -609,7 +610,7 @@ function sqimap_get_small_header_list ($imap_stream, $msg_list, $show_num=false)
             case 'BODY[HEADER.FIELDS':
                 $i = strpos($read,'{',$i);
                 $header = parseString($read,$i);
-                if ($header === false) break 3;
+                if ($header === false) break 2;
                 /* First we replace all \r\n by \n, and unfold the header */
                 $hdr = trim(str_replace(array("\r\n", "\n\t", "\n "),array("\n", ' ', ' '), $header));
                 /* Now we can make a new header array with */
@@ -710,7 +711,8 @@ function sqimap_get_small_header_list ($imap_stream, $msg_list, $show_num=false)
  * See the documentation folder for more information about this array.
  */
 function sqimap_get_message ($imap_stream, $id, $mailbox) {
-
+    // typecast to int to prohibit 1:* msgs sets
+    $id = (int) $id;
     $flags = array();
     $read = sqimap_run_command ($imap_stream, "FETCH $id (FLAGS BODYSTRUCTURE)", true, $response, $message, TRUE);
     if ($read) {
@@ -726,7 +728,7 @@ function sqimap_get_message ($imap_stream, $id, $mailbox) {
         $errmessage = _("The server couldn't find the message you requested.") .
               '<p>'._("Most probably your message list was out of date and the message has been moved away or deleted (perhaps by another program accessing the same mailbox).");
         /* this will include a link back to the message list */
-        error_message($errmessage, $mailbox, $sort, $startMessage, $color);
+        error_message($errmessage, $mailbox, $sort, (int) $startMessage, $color);
         exit;
     } 
     $bodystructure = implode('',$read);