10000 bug #29981 [Security] Complain about an empty decision strategy (corphi) · symfony/symfony@68d5597 · GitHub
[go: up one dir, main page]

Skip to content

Commit 68d5597

Browse files
committed
bug #29981 [Security] Complain about an empty decision strategy (corphi)
This PR was merged into the 3.4 branch. Discussion ---------- [Security] Complain about an empty decision strategy | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - When an empty string is passed (or objects with a similarly behaving `__toString()` method) to the constructor, the call to `decide` causes infinite recursion. Commits ------- 3a22cad Fix infinite recursion when passed an empty string
2 parents da16b9c + 3a22cad commit 68d5597

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class AccessDecisionManager implements AccessDecisionManagerInterface
4343
public function __construct($voters = [], $strategy = self::STRATEGY_AFFIRMATIVE, $allowIfAllAbstainDecisions = false, $allowIfEqualGrantedDeniedDecisions = true)
4444
{
4545
$strategyMethod = 'decide'.ucfirst($strategy);
46-
if (!\is_callable([$this, $strategyMethod])) {
46+
if ('' === $strategy || !\is_callable([$this, $strategyMethod])) {
4747
throw new \InvalidArgumentException(sprintf('The strategy "%s" is not supported.', $strategy));
4848
}
4949

0 commit comments

Comments
 (0)
0