From c04debf002afcb53fb510f578c8158045423cdb9 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Sun, 5 Jul 2009 22:54:55 -0600 Subject: [PATCH] POP3 fix --- imp/lib/Mailbox.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/imp/lib/Mailbox.php b/imp/lib/Mailbox.php index e43abac52..83a6eb879 100644 --- a/imp/lib/Mailbox.php +++ b/imp/lib/Mailbox.php @@ -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); } } -- 2.11.0