From cff92c0fd6b17d5dcfd4b31aa31f8ac2453ed967 Mon Sep 17 00:00:00 2001 From: Joshua Ferraro Date: Fri, 20 Jun 2008 14:09:12 -0500 Subject: [PATCH] Fix for 2187: http_accept_language feature not working --- C4/Output.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/C4/Output.pm b/C4/Output.pm index 6a48b875e8..3f96e8f4a3 100644 --- a/C4/Output.pm +++ b/C4/Output.pm @@ -132,7 +132,10 @@ sub themelanguage { # Set some defaults for language and theme # First, check the user's preferences my $lang; - my $http_accept_language = regex_lang_subtags($ENV{HTTP_ACCEPT_LANGUAGE})->{language}; + my $http_env = $ENV{HTTP_ACCEPT_LANGUAGE}; + $http_env =~ m/(\w+-*\w*),/; + my $language_preference = $1; + my $http_accept_language = regex_lang_subtags($language_preference)->{language}; if ($http_accept_language) { $lang = accept_language($http_accept_language,getTranslatedLanguages($interface,'prog')); } -- 2.39.5