From: Michael M Slusarz Date: Thu, 25 Jun 2009 23:16:02 +0000 (-0600) Subject: Use json encoding to save array data (lighter footprint) X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=2b8ebe33ee6071995b07e8f8ebf7fe533afcf202;p=horde.git Use json encoding to save array data (lighter footprint) --- diff --git a/imp/lib/Mailbox.php b/imp/lib/Mailbox.php index 7017404fe..9205d56af 100644 --- a/imp/lib/Mailbox.php +++ b/imp/lib/Mailbox.php @@ -100,9 +100,9 @@ class IMP_Mailbox if (!is_null($uid)) { /* Try to rebuild sorted information from the session cache. */ if (isset($_SESSION['imp']['cache']['imp_mailbox'][$mailbox])) { - $tmp = unserialize($_SESSION['imp']['cache']['imp_mailbox'][$mailbox]); - $this->_sorted = $tmp['s']; - $this->_sortedInfo = $tmp['i']; + $tmp = json_decode($_SESSION['imp']['cache']['imp_mailbox'][$mailbox]); + $this->_sorted = $tmp->s; + $this->_sortedInfo = $tmp->i; } $this->setIndex($uid); } @@ -117,7 +117,7 @@ class IMP_Mailbox public function __destruct() { if (!is_null($this->_arrayIndex)) { - $_SESSION['imp']['cache']['imp_mailbox'][$this->_mailbox] = serialize(array('i' => $this->_sortedInfo, 's' => $this->_sorted)); + $_SESSION['imp']['cache']['imp_mailbox'][$this->_mailbox] = json_encode(array('i' => $this->_sortedInfo, 's' => $this->_sorted)); } }