You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[HttpKernel] Add ControllerResolver::allowControllers() to define which callables are legit controllers when the _check_controller_is_allowed request attribute is set
Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ CHANGELOG
18
18
* Deprecate `FileLinkFormatter`, use `FileLinkFormatter` from the ErrorHandler component instead
19
19
* Add argument `$buildDir` to `WarmableInterface`
20
20
* Add argument `$filter` to `Profiler::find()` and `FileProfilerStorage::find()`
21
+
* Add `ControllerResolver::allowControllers()` to define which callables are legit controllers when the `_check_controller_is_allowed` request attribute is set
@@ -55,19 +77,19 @@ public function getController(Request $request): callable|false
55
77
thrownew \InvalidArgumentException(sprintf('The controller for URI "%s" is not callable: ', $request->getPathInfo()).$this->getControllerError($controller));
thrownew \InvalidArgumentException(sprintf('The controller for URI "%s" is not callable: ', $request->getPathInfo()).$this->getControllerError($controller));
@@ -80,7 +102,7 @@ public function getController(Request $request): callable|false
80
102
thrownew \InvalidArgumentException(sprintf('The controller for URI "%s" is not callable: ', $request->getPathInfo()).$this->getControllerError($callable));
if (-1 === $request->attributes->get('_check_controller_is_allowed')) {
272
+
trigger_deprecation('symfony/http-kernel', '6.4', 'Callable "%s()" is not allowed as a controller. Did you miss tagging it with "#[AsController]" or registering its type with "%s::allowControllers()"?', $name, self::class);
273
+
274
+
return$controller;
275
+
}
276
+
277
+
thrownewBadRequestException(sprintf('Callable "%s()" is not allowed as a controller. Did you miss tagging it with "#[AsController]" or registering its type with "%s::allowControllers()"?', $name, self::class));
0 commit comments