Skip to content
This repository was archived by the owner on Apr 15, 2025. It is now read-only.

Commit 2615070

Browse files
committed
Fixing issue with regex catching all languages
1 parent 83820aa commit 2615070

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

i18n.class.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ public function getUserLangs() {
284284
public static function parseLangCode($langCode, &$parentLangCode = null)
285285
{
286286
$langCode = strtolower($langCode);
287-
if(preg_match("/([\w]{2}(\-[\w]{2})*)/i", $langCode, $matches)){
287+
if(preg_match("/(([\w]{2})\-([\w]{2}))/i", $langCode, $matches)){
288288
$langCode = $matches[0];
289289
$parentLangCode = $matches[2];
290290
}else{

0 commit comments

Comments
 (0)