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>
$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' => '[^?]*'
+ ]);
+ }
}
}
}