mirror of
https://github.com/nextcloud/server.git
synced 2026-02-18 18:28:50 -05:00
Fix routes getting lost when loading app routes twice
This commit is contained in:
parent
e1d3d0e948
commit
d75c3d5f9a
1 changed files with 9 additions and 7 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue