aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/route
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-03-25 14:28:30 +0100
committerRobin Appelman <icewind@owncloud.com>2014-03-25 14:28:30 +0100
commitd75c3d5f9ab0f0c7a65a1d497311117ccdc981cd (patch)
tree0f2b91bfc9117a708da03128053fbd485f7b38fc /lib/private/route
parente1d3d0e9486f8816d9e180b5231e66af7211fba6 (diff)
downloadnextcloud-server-d75c3d5f9ab0f0c7a65a1d497311117ccdc981cd.tar.gz
nextcloud-server-d75c3d5f9ab0f0c7a65a1d497311117ccdc981cd.zip
Fix routes getting lost when loading app routes twice
Diffstat (limited to 'lib/private/route')
-rw-r--r--lib/private/route/router.php16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/private/route/router.php b/lib/private/route/router.php
index a9fad7bc292..bad74c925fa 100644
--- a/lib/private/route/router.php
+++ b/lib/private/route/router.php
@@ -114,12 +114,14 @@ class Router implements IRouter {
}
}
foreach ($routingFiles as $app => $file) {
- $this->loadedApps[$app] = true;
- $this->useCollection($app);
- require_once $file;
- $collection = $this->getCollection($app);
- $collection->addPrefix('/apps/' . $app);
- $this->root->addCollection($collection);
+ if (!$this->loadedApps[$app]) {
+ $this->loadedApps[$app] = true;
+ $this->useCollection($app);
+ require_once $file;
+ $collection = $this->getCollection($app);
+ $collection->addPrefix('/apps/' . $app);
+ $this->root->addCollection($collection);
+ }
}
if (!isset($this->loadedApps['core'])) {
$this->loadedApps['core'] = true;
@@ -181,7 +183,7 @@ class Router implements IRouter {
// empty string / 'apps' / $app / rest of the route
list(, , $app,) = explode('/', $url, 4);
$this->loadRoutes($app);
- } else if(substr($url, 0, 6) === '/core/' or substr($url, 0, 5) === '/ocs/' or substr($url, 0, 10) === '/settings/') {
+ } else if (substr($url, 0, 6) === '/core/' or substr($url, 0, 5) === '/ocs/' or substr($url, 0, 10) === '/settings/') {
$this->loadRoutes('core');
} else {
$this->loadRoutes();