From 0483fb9fdb8b80be9856c40c74e0d539d5b23ab8 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 1 Dec 2009 19:21:28 -0700 Subject: [PATCH] If pushApp() doesn't succeed, be sure to clear the app off the stack. --- framework/Core/lib/Horde/Registry.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/framework/Core/lib/Horde/Registry.php b/framework/Core/lib/Horde/Registry.php index 0a0b84616..0c76f3cf9 100644 --- a/framework/Core/lib/Horde/Registry.php +++ b/framework/Core/lib/Horde/Registry.php @@ -911,16 +911,22 @@ class Horde_Registry Horde::callHook('pushapp', array(), $app); } catch (Horde_Exception $e) { $e->setCode(self::HOOK_FATAL); + $this->popApp(); throw $e; } catch (Horde_Exception_HookNotSet $e) {} /* Initialize application. */ if ($checkPerms || !empty($options['init'])) { - if (file_exists($app_lib . '/base.php')) { - // TODO: Remove once there is no more base.php files - require_once $app_lib . '/base.php'; - } else { - $this->callAppMethod($app, 'init'); + try { + if (file_exists($app_lib . '/base.php')) { + // TODO: Remove once there is no more base.php files + require_once $app_lib . '/base.php'; + } else { + $this->callAppMethod($app, 'init'); + } + } catch (Horde_Exception $e) { + $this->popApp(); + throw $e; } } -- 2.11.0