summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-03-24 16:20:53 +0100
committerRobin Appelman <icewind@owncloud.com>2014-03-24 16:38:01 +0100
commit9e89ad07c64cba95093bc40a44daf54621275e15 (patch)
treedac50d89fee4ed2aeb598d319d8af278f0a7c751 /lib
parent0e1cb001b64f45597300282d41965aeff3d11188 (diff)
downloadnextcloud-server-9e89ad07c64cba95093bc40a44daf54621275e15.tar.gz
nextcloud-server-9e89ad07c64cba95093bc40a44daf54621275e15.zip
Only load core routes when matching a core route
Diffstat (limited to 'lib')
-rw-r--r--lib/private/route/router.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/private/route/router.php b/lib/private/route/router.php
index 28c27b601c1..a0e701d391a 100644
--- a/lib/private/route/router.php
+++ b/lib/private/route/router.php
@@ -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();
}