Partial re-revert; callHook() returns PEAR_Errors but the imp hook throws Exceptions
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 23 Feb 2009 18:18:45 +0000 (11:18 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 25 Feb 2009 03:55:03 +0000 (20:55 -0700)
imp/lib/Session.php

index 6f3e137..c686d85 100644 (file)
@@ -79,9 +79,12 @@ class IMP_Session
         /* Run the username through virtualhost expansion functions if
          * necessary. */
         if (!empty($conf['hooks']['vinfo'])) {
-            $hook_user = Horde::callHook('_imp_hook_vinfo', array('username', $imapuser), 'imp');
-            if (!is_a($hook_user, 'PEAR_Error')) {
-                $imapuser = $hook_user;
+            try {
+                $hook_user = Horde::callHook('_imp_hook_vinfo', array('username', $imapuser), 'imp');
+                if (!is_a($hook_user, 'PEAR_Error')) {
+                    $imapuser = $hook_user;
+                }
+            } catch (Horde_Exception $e) {
             }
         }