Fix infinite recursion when passed an empty string
This commit is contained in:
parent
51b72f3284
commit
3a22cad29b
@ -43,7 +43,7 @@ class AccessDecisionManager implements AccessDecisionManagerInterface
|
|||||||
public function __construct($voters = [], $strategy = self::STRATEGY_AFFIRMATIVE, $allowIfAllAbstainDecisions = false, $allowIfEqualGrantedDeniedDecisions = true)
|
public function __construct($voters = [], $strategy = self::STRATEGY_AFFIRMATIVE, $allowIfAllAbstainDecisions = false, $allowIfEqualGrantedDeniedDecisions = true)
|
||||||
{
|
{
|
||||||
$strategyMethod = 'decide'.ucfirst($strategy);
|
$strategyMethod = 'decide'.ucfirst($strategy);
|
||||||
if (!\is_callable([$this, $strategyMethod])) {
|
if ('' === $strategy || !\is_callable([$this, $strategyMethod])) {
|
||||||
throw new \InvalidArgumentException(sprintf('The strategy "%s" is not supported.', $strategy));
|
throw new \InvalidArgumentException(sprintf('The strategy "%s" is not supported.', $strategy));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user