Skip to content

Commit 5b389af

Browse files
committed
[HttpKernel] Prevent calling method_exists() with non-string values.
1 parent e7b59be commit 5b389af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Controller/ControllerResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function getController(Request $request)
7777
throw new \InvalidArgumentException(sprintf('Controller "%s" for URI "%s" is not callable.', \get_class($controller), $request->getPathInfo()));
7878
}
7979

80-
if (false === strpos($controller, ':')) {
80+
if (\is_string($controller) && false === strpos($controller, ':')) {
8181
if (method_exists($controller, '__invoke')) {
8282
return $this->instantiateController($controller);
8383
} elseif (\function_exists($controller)) {

0 commit comments

Comments
 (0)