diff --git a/core/lib/Drupal/Core/Path/AliasStorageInterface.php b/core/lib/Drupal/Core/Path/AliasStorageInterface.php index 5d22b46..598f986 100644 --- a/core/lib/Drupal/Core/Path/AliasStorageInterface.php +++ b/core/lib/Drupal/Core/Path/AliasStorageInterface.php @@ -138,7 +138,7 @@ public function languageAliasExists(); * Table header. * @param string|null $keys * (optional) Search keyword that may include one or more '*' as a wildcard - * value. Will be converted to lower case. + * value. This will be converted to lower case. * * @return array * Array of items to be displayed on the current page. diff --git a/core/lib/Drupal/Core/Routing/RouteBuilder.php b/core/lib/Drupal/Core/Routing/RouteBuilder.php index 0404cd4..fe90787 100644 --- a/core/lib/Drupal/Core/Routing/RouteBuilder.php +++ b/core/lib/Drupal/Core/Routing/RouteBuilder.php @@ -186,14 +186,12 @@ public function rebuild() { // static defined ones. $this->dispatcher->dispatch(RoutingEvents::DYNAMIC, new RouteBuildEvent($collection)); // Process the whole collection since we cannot tell what was newly added. - $this->processCollection($collection); + $this->applyLowerCaseCollection($collection); // ALTER is the final step to alter all the existing routes. We cannot stop // people from adding new routes here, but we define two separate steps to // make it clear. $this->dispatcher->dispatch(RoutingEvents::ALTER, new RouteBuildEvent($collection)); - // Process the whole collection again since we cannot tell what was changed. - $this->processCollection($collection); $this->checkProvider->setChecks($collection); @@ -234,9 +232,8 @@ public function destruct() { * @param \Symfony\Component\Routing\RouteCollection $collection * A route collection. */ - protected function processCollection(RouteCollection $collection) { - /** @var \Symfony\Component\Routing\Route $route */ - foreach ($collection as $route) { + protected function applyLowerCaseCollection(RouteCollection $collection) { + foreach ($collection->getAll() as $route) { // Force each path to be lower case. $path = Unicode::strtolower($route->getPath()); $route->setPath($path); diff --git a/core/lib/Drupal/Core/Routing/UrlMatcher.php b/core/lib/Drupal/Core/Routing/UrlMatcher.php index 0b97f0a..a7a4e75 100644 --- a/core/lib/Drupal/Core/Routing/UrlMatcher.php +++ b/core/lib/Drupal/Core/Routing/UrlMatcher.php @@ -49,23 +49,23 @@ public function finalMatch(RouteCollection $collection, Request $request) { /** * Tries to match a URL with a set of routes. * - * This version differe from the Symfony parent version in two respects. + * This version differs from the Symfony parent version in two respects. * First, the $pathinfo string is converted to lower case. In addition, we * remove the check against any static prefix since we would already have * matched the static prefix in \Drupal\Core\Routing\RouteProvider before * arriving here. * * @param string $pathinfo - * The path info to be parsed + * The path info to be parsed. * @param RouteCollection $routes - * The set of routes + * The set of routes. * * @return array An array of parameters * * @throws \Symfony\Component\Routing\Exception\ResourceNotFoundException - * If the resource could not be found + * If the resource could not be found. * @throws \Symfony\Component\Routing\Exception\MethodNotAllowedException - * If the resource was found but the request method is not allowed + * If the resource was found but the request method is not allowed. */ protected function matchCollection($pathinfo, RouteCollection $routes) {