Skip to content

Commit 90a6f89

Browse files
Merge branch '4.4' into 5.0
* 4.4: [HttpFoundation] Do not set the default Content-Type based on the Accept header [Security] Fix access_control behavior with unanimous decision strategy
2 parents edad274 + e99ad8b commit 90a6f89

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Authorization/AccessDecisionManager.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,16 @@ public function __construct(iterable $voters = [], string $strategy = self::STRA
5454
}
5555

5656
/**
57+
* @param bool $allowMultipleAttributes Whether to allow passing multiple values to the $attributes array
58+
*
5759
* {@inheritdoc}
5860
*/
59-
public function decide(TokenInterface $token, array $attributes, $object = null)
61+
public function decide(TokenInterface $token, array $attributes, $object = null/*, bool $allowMultipleAttributes = false*/)
6062
{
61-
if (\count($attributes) > 1) {
63+
$allowMultipleAttributes = 3 < func_num_args() && func_get_arg(3);
64+
65+
// Special case for AccessListener, do not remove the right side of the condition before 6.0
66+
if (\count($attributes) > 1 && !$allowMultipleAttributes) {
6267
throw new InvalidArgumentException(sprintf('Passing more than one Security attribute to "%s()" is not supported.', __METHOD__));
6368
}
6469

0 commit comments

Comments
 (0)