Match slashes in ../{id} resource routes

Fixes #2954

Before we could match on <prefix>/{id} however if the id contains a /
this would not match properly. But since we define the resource routes
internally we now make sure that we match all chars (up until the ?).

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
pull/4138/head
Roeland Jago Douma 9 years ago
parent ec5377306d
commit 31f9be7a75
No known key found for this signature in database
GPG Key ID: F941078878347C0C
  1. 8
      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' => '[^?]*'
]);
}
}
}
}

Loading…
Cancel
Save