diff --git a/core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationUrl.php b/core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationUrl.php index 7940c97..7436a3f 100644 --- a/core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationUrl.php +++ b/core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationUrl.php @@ -100,10 +100,11 @@ public function getLangcode(Request $request = NULL) { */ public function processInbound($path, Request $request) { $config = $this->config->get('language.negotiation')->get('url'); - $parts = explode('/', trim($path, '/')); - $prefix = array_shift($parts); if ($config['source'] == LanguageNegotiationUrl::CONFIG_PATH_PREFIX) { + $parts = explode('/', trim($path, '/')); + $prefix = array_shift($parts); + // Search prefix within added languages. foreach ($this->languageManager->getLanguages() as $language) { if (isset($config['prefixes'][$language->getId()]) && $config['prefixes'][$language->getId()] == $prefix) {