From 737287f936de0dce9beb554aeb117ad7fc7cabe0 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Sat, 4 Sep 2010 02:16:28 -0600 Subject: [PATCH] Catch bad Imap client unserializations --- imp/lib/Imap.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/imp/lib/Imap.php b/imp/lib/Imap.php index 8ebb94841..215a415c7 100644 --- a/imp/lib/Imap.php +++ b/imp/lib/Imap.php @@ -101,8 +101,9 @@ class IMP_Imap return false; } - $this->ob = @unserialize($_SESSION['imp']['imap_ob'][$this->_serverkey]); - if (empty($this->ob)) { + try { + $this->ob = @unserialize($_SESSION['imp']['imap_ob'][$this->_serverkey]); + } catch (Exception $e) { /* Throw fatal error here - should never reach here and if we * do, we are out of luck. */ throw new IMP_Exception(_("Could not acquire mail server credentials from the session.")); -- 2.11.0