mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 19:23:24 +02:00
captive: Show access page in browser language
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org> Tested-by: Daniel Weismüller <daniel.weismüller@ipfire.org>
This commit is contained in:
@@ -179,4 +179,18 @@ sub FindWebLanguage() {
|
||||
return undef;
|
||||
}
|
||||
|
||||
sub DetectBrowserLanguages() {
|
||||
my $langs = $ENV{"HTTP_ACCEPT_LANGUAGE"};
|
||||
my @results = ();
|
||||
|
||||
foreach my $lang (split /[,;]/, $langs) {
|
||||
# Drop all q= arguments
|
||||
next if ($lang =~ m/^q=/);
|
||||
|
||||
push(@results, $lang);
|
||||
}
|
||||
|
||||
return @results;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
Reference in New Issue
Block a user