10000 bug #24304 [FrameworkBundle] Fix Routing\DelegatingLoader (nicolas-gr… · symfony/symfony@4129fd2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4129fd2

Browse files
bug #24304 [FrameworkBundle] Fix Routing\DelegatingLoader (nicolas-grekas)
This PR was merged into the 2.7 branch. Discussion ---------- [FrameworkBundle] Fix Routing\DelegatingLoader | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Spotted while reviewing: the default controller is not always a string, so parsing should only be done conditionally. Commits ------- a69c1b2 [FrameworkBundle] Fix Routing\DelegatingLoader
2 parents a40c94d + a69c1b2 commit 4129fd2

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Symfony/Bundle/FrameworkBundle/Routing/DelegatingLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function load($resource, $type = null)
8585
$this->loading = false;
8686

8787
foreach ($collection->all() as $route) {
88-
if (!$controller = $route->getDefault('_controller')) {
88+
if (!is_string($controller = $route->getDefault('_controller')) || !$controller) {
8989
continue;
9090
}
9191

src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Resources/config/routing.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,7 @@ fragment_home:
4444
fragment_inlined:
4545
path: /fragment_inlined
4646
defaults: { _controller: TestBundle:Fragment:inlined }
47+
48+
array_controller:
49+
path: /array_controller
50+
defaults: { _controller: [ArrayController, someAction] }

0 commit comments

Comments
 (0)
0