Replace array_search that only uses a boolean to check whether the value
[squirrelmail.git] / functions / imap_mailbox.php
index 13eab2d4d868c18907c3d77753023506c1d1d58b..e2198947a7629fdfa923d45494c76eec7f4c194c 100755 (executable)
@@ -269,7 +269,7 @@ function sqimap_mailbox_expunge_dmn($imapConnection, &$aMailbox, $message_id) {
     $message_id = (int) $message_id; // we use strickt array_search
     if (is_array($aMailbox['UIDSET'])) {
         $key = array_search($message_id,$aMailbox['UIDSET'],true);
-        if ($key !== false) {
+        if ($key !== false && !is_null($key)) {
             unset($aMailbox['UIDSET'][$key]);
             $aMailbox['UIDSET'] = array_values($aMailbox['UIDSET']);
             // adapt the exists count to avoid triggering of a new sort