Skip to content

Commit 19786a7

Browse files
authored
Normalize language code case in LangChooser (#1303)
1 parent f925065 commit 19786a7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/LangChooser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function chooseCode(
9797
// The language part is either a code or a code with a quality
9898
// We cannot do anything with a * code, so it is skipped
9999
// If the quality is missing, it is assumed to be 1 according to the RFC
100-
if (preg_match("!([a-z-]+)(;q=([0-9\\.]+))?!", trim($value), $found)) {
100+
if (preg_match("!([a-z-]+)(;q=([0-9\\.]+))?!", strtolower(trim($value)), $found)) {
101101
$quality = (isset($found[3]) ? (float) $found[3] : 1.0);
102102
$browser_langs[] = [$found[1], $quality];
103103
}

0 commit comments

Comments
 (0)