diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-08-10 21:42:13 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-08-10 21:42:13 +0200 |
commit | 54aa57b47a9bd8f7e6f2f81f1b229eb19c1e135b (patch) | |
tree | 9d79506c25d2fe9af0caf7eb790144a3c71307cb /lib | |
parent | bfb9a8e58e1a8d613a7eaf0c3422e079abfcacb9 (diff) | |
parent | 50ebea41f60f2864a565ea9985c5462c2df5f09e (diff) | |
download | nextcloud-server-54aa57b47a9bd8f7e6f2f81f1b229eb19c1e135b.tar.gz nextcloud-server-54aa57b47a9bd8f7e6f2f81f1b229eb19c1e135b.zip |
Merge pull request #18109 from owncloud/fix-router-app-loaded
Only load app routes if the app has already been loaded
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/app.php | 10 | ||||
-rw-r--r-- | lib/private/route/router.php | 6 |
2 files changed, 16 insertions, 0 deletions
diff --git a/lib/private/app.php b/lib/private/app.php index 74b21b2b107..e51fe73cb19 100644 --- a/lib/private/app.php +++ b/lib/private/app.php @@ -74,6 +74,16 @@ class OC_App { } /** + * Check if an app is loaded + * + * @param string $app + * @return bool + */ + public static function isAppLoaded($app) { + return in_array($app, self::$loadedApps, true); + } + + /** * loads all apps * * @param array $types diff --git a/lib/private/route/router.php b/lib/private/route/router.php index 48992366092..33669452f2d 100644 --- a/lib/private/route/router.php +++ b/lib/private/route/router.php @@ -150,6 +150,12 @@ class Router implements IRouter { \OC::$server->getEventLogger()->start('loadroutes' . $requestedApp, 'Loading Routes'); foreach ($routingFiles as $app => $file) { if (!isset($this->loadedApps[$app])) { + if (!\OC_App::isAppLoaded($app)) { + // app MUST be loaded before app routes + // try again next time loadRoutes() is called + $this->loaded = false; + continue; + } $this->loadedApps[$app] = true; $this->useCollection($app); $this->requireRouteFile($file, $app); |