bug #29191 [Routing] generate(null) should throw an exception (nicolas-grekas)
This PR was merged into the 4.1 branch.
Discussion
----------
[Routing] generate(null) should throw an exception
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28634
| License | MIT
| Doc PR | -
Commits
-------
710aafbc91
[Routing] generate(null) should throw an exception
This commit is contained in:
commit
c96325ff57
@ -113,7 +113,7 @@ EOF;
|
|||||||
?? $this->context->getParameter('_locale')
|
?? $this->context->getParameter('_locale')
|
||||||
?: $this->defaultLocale;
|
?: $this->defaultLocale;
|
||||||
|
|
||||||
if (null !== $locale && (self::$declaredRoutes[$name.'.'.$locale][1]['_canonical_route'] ?? null) === $name) {
|
if (null !== $locale && (self::$declaredRoutes[$name.'.'.$locale][1]['_canonical_route'] ?? null) === $name && null !== $name) {
|
||||||
unset($parameters['_locale']);
|
unset($parameters['_locale']);
|
||||||
$name .= '.'.$locale;
|
$name .= '.'.$locale;
|
||||||
} elseif (!isset(self::$declaredRoutes[$name])) {
|
} elseif (!isset(self::$declaredRoutes[$name])) {
|
||||||
|
Reference in New Issue
Block a user