Catch bad Imap client unserializations
authorMichael M Slusarz <slusarz@curecanti.org>
Sat, 4 Sep 2010 08:16:28 +0000 (02:16 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 6 Sep 2010 20:31:16 +0000 (14:31 -0600)
imp/lib/Imap.php

index 8ebb948..215a415 100644 (file)
@@ -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."));