Skip to content

Commit 16b9bd5

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

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
@@ -55,11 +55,16 @@ public function __construct(iterable $voters = [], string $strategy = self::STRA
5555
}
5656

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

0 commit comments

Comments
 (0)