Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
Silex
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
Silex
Commits
9698b776
Commit
9698b776
authored
Jan 25, 2016
by
quazardous
Committed by
Fabien Potencier
Mar 10, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow use of all the RequestMatcher parameters by providing an array
parent
5a7a491f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
src/Silex/Provider/SecurityServiceProvider.php
src/Silex/Provider/SecurityServiceProvider.php
+10
-1
No files found.
src/Silex/Provider/SecurityServiceProvider.php
View file @
9698b776
...
...
@@ -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
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment