summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-04-04 15:52:53 -0500
committerGitHub <noreply@github.com>2017-04-04 15:52:53 -0500
commitfa4107893de4e94020dc1b3182cfea969b5db1a6 (patch)
tree80fd4e8904f4a0f02f6368231a4c1710b99b4eec
parentb78876236dcc604ff128875f077bb2afdcca37a3 (diff)
parent31f9be7a75712e9f8b7831ed29397527f9fa8baf (diff)
downloadnextcloud-server-fa4107893de4e94020dc1b3182cfea969b5db1a6.tar.gz
nextcloud-server-fa4107893de4e94020dc1b3182cfea969b5db1a6.zip
Merge pull request #4138 from nextcloud/resources_match_fullid
Match slashes in ../{id} resource routes
-rw-r--r--lib/private/AppFramework/Routing/RouteConfig.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/AppFramework/Routing/RouteConfig.php b/lib/private/AppFramework/Routing/RouteConfig.php
index 70208725f46..e2675a3c847 100644
--- a/lib/private/AppFramework/Routing/RouteConfig.php
+++ b/lib/private/AppFramework/Routing/RouteConfig.php
@@ -231,9 +231,15 @@ class RouteConfig {
$routeName = $this->appName . '.' . strtolower($resource) . '.' . strtolower($method);
- $this->router->create($routeName, $url)->method($verb)->action(
+ $route = $this->router->create($routeName, $url)->method($verb)->action(
new RouteActionHandler($this->container, $controllerName, $actionName)
);
+
+ if (!$collectionAction) {
+ $route->requirements([
+ 'id' => '[^?]*'
+ ]);
+ }
}
}
}