From 94cd83ca00c5dd77b168bb21c494ff4fd8434ebc Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Tue, 17 May 2016 10:12:33 +0200 Subject: [PATCH] Make the router handle OCS AppFramework Routes --- lib/private/Route/Router.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/private/Route/Router.php b/lib/private/Route/Router.php index 01262be390..f7da827c3d 100644 --- a/lib/private/Route/Router.php +++ b/lib/private/Route/Router.php @@ -150,6 +150,11 @@ class Router implements IRouter { $collection = $this->getCollection($app); $collection->addPrefix('/apps/' . $app); $this->root->addCollection($collection); + + // Also add the OCS collection + $collection = $this->getCollection($app.'.ocs'); + $collection->addPrefix('/ocsapp/apps/' . $app); + $this->root->addCollection($collection); } } if (!isset($this->loadedApps['core'])) { @@ -238,6 +243,13 @@ class Router implements IRouter { // empty string / 'apps' / $app / rest of the route list(, , $app,) = explode('/', $url, 4); + $app = \OC_App::cleanAppId($app); + \OC::$REQUESTEDAPP = $app; + $this->loadRoutes($app); + } else if (substr($url, 0, 13) === '/ocsapp/apps/') { + // empty string / 'ocsapp' / 'apps' / $app / rest of the route + list(, , , $app,) = explode('/', $url, 5); + $app = \OC_App::cleanAppId($app); \OC::$REQUESTEDAPP = $app; $this->loadRoutes($app);