From a1f7f6d9e7dcbdc2d62e34f273bdb466f6810f2c Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 9 Sep 2010 15:03:02 -0600 Subject: [PATCH] consolidate some code --- framework/Core/lib/Horde.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/framework/Core/lib/Horde.php b/framework/Core/lib/Horde.php index e0fcc2dc0..6a2460e5f 100644 --- a/framework/Core/lib/Horde.php +++ b/framework/Core/lib/Horde.php @@ -1680,19 +1680,12 @@ HTML; if (!class_exists($hook_class)) { try { self::loadConfiguration('hooks.php', null, $app); - } catch (Horde_Exception $e) { - $error = true; - } - } - - if (class_exists($hook_class)) { - $hook_ob = new $hook_class; - $error = !method_exists($hook_ob, $hook); - } else { - $error = true; + } catch (Horde_Exception $e) {} } - if ($error) { + if (!class_exists($hook_class) || + !($hook_ob = new $hook_class) || + !method_exists($hook_ob, $hook)) { throw new Horde_Exception_HookNotSet(); } -- 2.11.0