From c1297645585386880cd74d3b6a750d059baf609b Mon Sep 17 00:00:00 2001 From: Kristen Pol Date: Tue, 30 Jan 2024 16:37:04 -0800 Subject: [PATCH] Added check for empty language prefix. --- src/EventSubscriber/CollectionSubscriber.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/EventSubscriber/CollectionSubscriber.php b/src/EventSubscriber/CollectionSubscriber.php index c597d722..a4bed6e9 100644 --- a/src/EventSubscriber/CollectionSubscriber.php +++ b/src/EventSubscriber/CollectionSubscriber.php @@ -310,10 +310,12 @@ public function collectRoutes(CollectRoutesEvent $event) { $base = \Drupal::request()->getBaseUrl(); $event->queueItem(['route' => $base . "/{$path}"]); - // Languge negotiation may also provide path prefixes. + // Language negotiation may also provide path prefixes. if ($prefixes = \Drupal::config('language.negotiation')->get('url.prefixes')) { foreach ($prefixes as $prefix) { - $event->queueItem(['route' => "/{$prefix}/{$path}"]); + if ($prefix) { + $event->queueItem(['route' => "/{$prefix}/{$path}"]); + } } } }