Skip to content

Commit c537c85

Browse files
committed
Fix infinite recursion when passed an empty string
1 parent f797a78 commit c537c85

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ class AccessDecisionManager implements AccessDecisionManagerInterface
4242
*/
4343
public function __construct($voters = [], $strategy = self::STRATEGY_AFFIRMATIVE, $allowIfAllAbstainDecisions = false, $allowIfEqualGrantedDeniedDecisions = true)
4444
{
45+
$strategy = (string) $strategy;
4546
$strategyMethod = 'decide'.ucfirst($strategy);
46-
if (!\is_callable([$this, $strategyMethod])) {
47+
if (!\is_callable([$this, $strategyMethod]) || 0 === \strlen($strategy)) {
4748
throw new \InvalidArgumentException(sprintf('The strategy "%s" is not supported.', $strategy));
4849
}
4950

0 commit comments

Comments
 (0)