Skip to content

Commit d3da842

Browse files
committed
Normalize language code case in LangChooser
1 parent 9c9b9ac commit d3da842

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)