Need to push app on stack earlier to prevent loop
authorMichael M Slusarz <slusarz@curecanti.org>
Sun, 11 Apr 2010 01:37:21 +0000 (19:37 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Sun, 11 Apr 2010 01:37:21 +0000 (19:37 -0600)
framework/Core/lib/Horde/Registry.php

index 6efa5b7..10c7f94 100644 (file)
@@ -1073,6 +1073,9 @@ class Horde_Registry
             throw new Horde_Exception(sprintf(_('%s is not authorized for %s.'), Horde_Auth::getAuth() ? 'User ' . Horde_Auth::getAuth() : 'Guest user', $this->applications[$app]['name']), self::PERMISSION_DENIED);
         }
 
+        /* Push application on the stack. */
+        $this->_appStack[] = $app;
+
         /* Set up autoload paths for the current application. This needs to
          * be done here because it is possible to try to load app-specific
          * libraries from other applications. */
@@ -1104,10 +1107,6 @@ class Horde_Registry
             }
         }
 
-        /* Once we know everything succeeded and is in a consistent state
-         * again, push the new application onto the stack. */
-        $this->_appStack[] = $app;
-
         /* Call post-push hook. */
         try {
             Horde::callHook('pushapp', array(), $app);