From 9e6b89cf9331fccb8f41ae0b1785e21c8c5d62f0 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Mon, 8 Apr 2024 09:08:19 -0400 Subject: [PATCH] Fix issue in PagePathFinder where LanguageSupportPageNames module in use without using homepage language segments, combined with multi-language PagePathHistory module, could result in default language incorrectly detected from URL. --- wire/core/PagesPathFinder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wire/core/PagesPathFinder.php b/wire/core/PagesPathFinder.php index a3a3cc33..0c27edae 100644 --- a/wire/core/PagesPathFinder.php +++ b/wire/core/PagesPathFinder.php @@ -789,7 +789,7 @@ class PagesPathFinder extends Wire { // if there were any non-default language segments, let that dictate the language if(empty($result['language']['segment'])) { - $useLangName = 'default'; + $useLangName = count($result['parts']) ? 'default' : $result['language']['name']; foreach($result['parts'] as $part) { $langName = $part['language']; if(empty($langName) || $langName === 'default') continue;