From ab12ca81d09e2e6251fd495c700cdbaf0e01e287 Mon Sep 17 00:00:00 2001 From: Philipp Cordes Date: Fri, 25 Jan 2019 00:11:57 +0100 Subject: [PATCH] Fix infinite recursion when passed an empty string --- .../Security/Core/Authorization/AccessDecisionManager.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php b/src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php index 39cca72b7b9bc..9c7c268c75d6f 100644 --- a/src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php +++ b/src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php @@ -42,7 +42,7 @@ class AccessDecisionManager implements AccessDecisionManagerInterface */ public function __construct($voters = [], $strategy = self::STRATEGY_AFFIRMATIVE, $allowIfAllAbstainDecisions = false, $allowIfEqualGrantedDeniedDecisions = true) { - $strategyMethod = 'decide'.ucfirst($strategy); + $strategyMethod = 'doDecide'.ucfirst($strategy); if (!\is_callable([$this, $strategyMethod])) { throw new \InvalidArgumentException(sprintf('The strategy "%s" is not supported.', $strategy)); } @@ -81,7 +81,7 @@ public function decide(TokenInterface $token, array $attributes, $object = null) * If all voters abstained from voting, the decision will be based on the * allowIfAllAbstainDecisions property value (defaults to false). */ - private function decideAffirmative(TokenInterface $token, array $attributes, $object = null) + private function doDecideAffirmative(TokenInterface $token, array $attributes, $object = null) { $deny = 0; foreach ($this->voters as $voter) { @@ -121,7 +121,7 @@ private function decideAffirmative(TokenInterface $token, array $attributes, $ob * If all voters abstained from voting, the decision will be based on the * allowIfAllAbstainDecisions property value (defaults to false). */ - private function decideConsensus(TokenInterface $token, array $attributes, $object = null) + private function doDecideConsensus(TokenInterface $token, array $attributes, $object = null) { $grant = 0; $deny = 0; @@ -162,7 +162,7 @@ private function decideConsensus(TokenInterface $token, array $attributes, $obje * If all voters abstained from voting, the decision will be based on the * allowIfAllAbstainDecisions property value (defaults to false). */ - private function decideUnanimous(TokenInterface $token, array $attributes, $object = null) + private function doDecideUnanimous(TokenInterface $token, array $attributes, $object = null) { $grant = 0; foreach ($this->voters as $voter) {