POP3 fix
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 6 Jul 2009 04:54:55 +0000 (22:54 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 6 Jul 2009 04:54:55 +0000 (22:54 -0600)
imp/lib/Mailbox.php

index e43abac..83a6eb8 100644 (file)
@@ -119,10 +119,15 @@ class IMP_Mailbox
     {
         if (!is_null($this->_arrayIndex)) {
             /* Casting $_sorted to integers saves a significant amount of
-             * space when json_encoding (no need to quote every value). */
+             * space when json_encoding (no need to quote every value). Only
+             * can do for IMAP though (since POP3 UIDs are not limited to
+             * integers. */
+            $sorted = ($_SESSION['imp']['protocol'] == 'pop')
+                ? $this->_sorted
+                : array_map('intval', $this->_sorted);
             $_SESSION['imp']['cache']['imp_mailbox'][$this->_mailbox] = $this->_searchmbox
-                ? json_encode(array('m' => $this->_sortedMbox, 's' => array_map('intval', $this->_sorted)))
-                : json_encode(array_map('intval', $this->_sorted));
+                ? json_encode(array('m' => $this->_sortedMbox, 's' => $sorted))
+                : json_encode($sorted);
         }
     }