File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
src/Symfony/Bundle/SecurityBundle/Security Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -147,12 +147,14 @@ public function getFirewallConfig(Request $request)
147147 private function getFirewallContext (Request $ request )
148148 {
149149 if ($ request ->attributes ->has ('_firewall_context ' )) {
150- $ contextId = $ request ->attributes ->get ('_firewall_context ' );
151- if ( array_key_exists ( $ contextId , $ this ->map ) ) {
152- return $ this -> container -> get ($ contextId);
153- } else {
154- $ request -> attributes -> remove ( ' _firewall_context ' );
150+ $ storedContextId = $ request ->attributes ->get ('_firewall_context ' );
151+ foreach ( $ this ->map as $ contextId => $ requestMatcher ) {
152+ if ($ contextId === $ storedContextId ) {
153+ return $ this -> container -> get ( $ contextId );
154+ }
155155 }
156+
157+ $ request ->attributes ->remove ('_firewall_context ' );
156158 }
157159
158160 foreach ($ this ->map as $ contextId => $ requestMatcher ) {
You can’t perform that action at this time.
0 commit comments