]> source.dussan.org Git - nextcloud-server.git/commitdiff
Only load core routes when matching a core route
authorRobin Appelman <icewind@owncloud.com>
Mon, 24 Mar 2014 15:20:53 +0000 (16:20 +0100)
committerRobin Appelman <icewind@owncloud.com>
Mon, 24 Mar 2014 15:38:01 +0000 (16:38 +0100)
lib/private/route/router.php

index 28c27b601c180e35b060874ed4695f268eb172f7..a0e701d391a5c6f1e64f5c69d91395ae46428d91 100644 (file)
@@ -106,15 +106,15 @@ class Router implements IRouter {
                        if (isset($this->loadedApps[$app])) {
                                return;
                        }
-                       $this->loadedApps[$app] = true;
                        $file = \OC_App::getAppPath($app) . '/appinfo/routes.php';
                        if (file_exists($file)) {
-                               $routingFiles = array($file);
+                               $routingFiles[$app] = array($file);
                        } else {
                                $routingFiles = array();
                        }
                }
                foreach ($routingFiles as $app => $file) {
+                       $this->loadedApps[$app] = true;
                        $this->useCollection($app);
                        require_once $file;
                        $collection = $this->getCollection($app);
@@ -171,7 +171,7 @@ class Router implements IRouter {
        }
 
        /**
-        * Find the route matching $url.
+        * Find the route matching $url
         *
         * @param string $url The url to find
         * @throws \Exception
@@ -180,6 +180,8 @@ class Router implements IRouter {
                if (substr($url, 0, 6) === '/apps/') {
                        list(, , $app,) = explode('/', $url, 4);
                        $this->loadRoutes($app);
+               } else if(substr($url, 0, 6) === '/core/') {
+                       $this->loadRoutes('core');
                } else {
                        $this->loadRoutes();
                }