Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/LangChooser.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function chooseCode(
// The language part is either a code or a code with a quality
// We cannot do anything with a * code, so it is skipped
// If the quality is missing, it is assumed to be 1 according to the RFC
if (preg_match("!([a-z-]+)(;q=([0-9\\.]+))?!", trim($value), $found)) {
if (preg_match("!([a-z-]+)(;q=([0-9\\.]+))?!", strtolower(trim($value)), $found)) {
$quality = (isset($found[3]) ? (float) $found[3] : 1.0);
$browser_langs[] = [$found[1], $quality];
}
Expand Down