Add compatibility with Dovecot's bigint UIDs
[squirrelmail.git] / functions / mailbox_display.php
index 1468e80f460be6c0ba15ca3a4722c1462ab98977..9fb3725cf0ffbbed200071e9f0c018736a8a7b6f 100644 (file)
@@ -1334,6 +1334,11 @@ function handleMessageListForm($imapConnection, &$aMailbox, $sButton='',
     /* retrieve the check boxes */
     $aUid = (isset($msg) && is_array($msg)) ? array_values($msg) : $aUid;
     if (count($aUid) && $sButton != 'expunge') {
+
+        // make sure message UIDs are sanitized (BIGINT)
+        foreach ($aUid as $i => $uid)
+           $aUid[$i] = (preg_match('/^[0-9]+$/', $uid) ? $uid : '0');
+
         $aUpdatedMsgs = false;
         $bExpunge = false;
         switch ($sButton) {