[HttpKernel] Prevent calling method_exists() with non-string values.

This commit is contained in:
Alexander M. Turek 2020-05-22 15:23:31 +02:00
parent 52abcbeec9
commit 1bbfdcbb8d
1 changed files with 1 additions and 1 deletions

View File

@ -77,7 +77,7 @@ class ControllerResolver implements ArgumentResolverInterface, ControllerResolve
throw new \InvalidArgumentException(sprintf('Controller "%s" for URI "%s" is not callable.', \get_class($controller), $request->getPathInfo()));
}
if (false === strpos($controller, ':')) {
if (\is_string($controller) && false === strpos($controller, ':')) {
if (method_exists($controller, '__invoke')) {
return $this->instantiateController($controller);
} elseif (\function_exists($controller)) {