Commit 9698b776 authored by quazardous's avatar quazardous Committed by Fabien Potencier

Allow use of all the RequestMatcher parameters by providing an array

parent 5a7a491f
......@@ -318,8 +318,17 @@ class SecurityServiceProvider implements ServiceProviderInterface, EventListener
foreach ($app['security.access_rules'] as $rule) {
if (is_string($rule[0])) {
$rule[0] = new RequestMatcher($rule[0]);
} elseif (is_array($rule[0])) {
$rule[0] += [
'path' => null,
'host' => null,
'methods' => null,
'ips' => null,
'attributes' => null,
'schemes' => null,
];
$rule[0] = new RequestMatcher($rule[0]['path'], $rule[0]['host'], $rule[0]['methods'], $rule[0]['ips'], $rule[0]['attributes'], $rule[0]['schemes']);
}
$map->add($rule[0], (array) $rule[1], isset($rule[2]) ? $rule[2] : null);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment