Skip to content

Commit 09ec933

Browse files
committed
Use original slug as fallback in UrlDetector
1 parent 9789cd9 commit 09ec933

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Detectors/UrlDetector.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ public function detect()
2525
}
2626

2727
// Find the locale that belongs to the custom domain or slug.
28+
// Return the original slug as fallback.
29+
// The calling code should validate and handle it.
2830
$domain = Request::getHttpHost();
2931
$locales = $this->flipLocalesArray($locales);
30-
$locale = $locales[$domain] ?? $locales[$slug] ?? null;
32+
$locale = $locales[$domain] ?? $locales[$slug] ?? $slug;
3133

3234
return $locale;
3335
}

0 commit comments

Comments
 (0)