[HttpKernel] fixed a crash on some machines (check that the controller is actually a class name before calling method_exists, closes #769)

This commit is contained in:
Fabien Potencier 2011-06-15 17:22:18 +02:00
parent b3fa8bf7cb
commit e145bdf6ff

View File

@ -60,7 +60,7 @@ class ControllerResolver implements ControllerResolverInterface
return false;
}
if (is_array($controller) || method_exists($controller, '__invoke')) {
if (is_array($controller) || ((is_object($controller) || false === strpos($controller, ':')) && method_exists($controller, '__invoke'))) {
return $controller;
}