summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorBernhard Posselt <Raydiation@users.noreply.github.com>2014-04-10 21:34:57 +0200
committerBernhard Posselt <Raydiation@users.noreply.github.com>2014-04-10 21:34:57 +0200
commitbf898f90bcc5b09edcfca2379394088b087ffaea (patch)
tree8de270b28c00eb119e0697928ed4e82955007158 /lib/private
parentde7a3861f378102ea7a30db7f09a8b1af33b7311 (diff)
parentfc8004d335782374c5a78ed652e3b88263dd1875 (diff)
downloadnextcloud-server-bf898f90bcc5b09edcfca2379394088b087ffaea.tar.gz
nextcloud-server-bf898f90bcc5b09edcfca2379394088b087ffaea.zip
Merge pull request #8151 from owncloud/backport-8137-stable6
add requirements to routing
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/appframework/routing/routeconfig.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/private/appframework/routing/routeconfig.php b/lib/private/appframework/routing/routeconfig.php
index 53ab11bf2f5..19acc0c27f0 100644
--- a/lib/private/appframework/routing/routeconfig.php
+++ b/lib/private/appframework/routing/routeconfig.php
@@ -84,7 +84,15 @@ class RouteConfig {
// register the route
$handler = new RouteActionHandler($this->container, $controllerName, $actionName);
- $this->router->create($this->appName.'.'.$controller.'.'.$action, $url)->method($verb)->action($handler);
+ $router = $this->router->create($this->appName.'.'.$controller.'.'.$action, $url)
+ ->method($verb)
+ ->action($handler);
+
+ // optionally register requirements for route. This is used to
+ // tell the route parser how url parameters should be matched
+ if(array_key_exists('requirements', $simpleRoute)) {
+ $router->requirements($simpleRoute['requirements']);
+ }
}
}