Skip to content

Commit

Permalink
Fix infinite recursion when passed an empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
corphi committed Jan 27, 2019
1 parent f797a78 commit 42e34f4
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -42,8 +42,9 @@ class AccessDecisionManager implements AccessDecisionManagerInterface
*/
public function __construct($voters = [], $strategy = self::STRATEGY_AFFIRMATIVE, $allowIfAllAbstainDecisions = false, $allowIfEqualGrantedDeniedDecisions = true)
{
$strategy = (string) $strategy;
$strategyMethod = 'decide'.ucfirst($strategy);
if (!\is_callable([$this, $strategyMethod])) {
if (!\is_callable([$this, $strategyMethod]) || 0 === \strlen($strategy)) {
throw new \InvalidArgumentException(sprintf('The strategy "%s" is not supported.', $strategy));
}

Expand Down

0 comments on commit 42e34f4

Please sign in to comment.