Commit ae89fa81 authored by mkanat%bugzilla.org's avatar mkanat%bugzilla.org

Bug 390756: Hook.pm couldn't find Bugzilla::Template::sortAcceptLanguage,…

Bug 390756: Hook.pm couldn't find Bugzilla::Template::sortAcceptLanguage, because it didn't exist anymore. Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, r=Wurblzap, a=LpSolit
parent cca9361a
...@@ -26,6 +26,7 @@ package Bugzilla::Template::Plugin::Hook; ...@@ -26,6 +26,7 @@ package Bugzilla::Template::Plugin::Hook;
use strict; use strict;
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Install::Util;
use Bugzilla::Template; use Bugzilla::Template;
use Bugzilla::Util; use Bugzilla::Util;
use Bugzilla::Error; use Bugzilla::Error;
...@@ -110,8 +111,11 @@ sub getLanguages() { ...@@ -110,8 +111,11 @@ sub getLanguages() {
if (not ($languages =~ /,/)) { # only one language if (not ($languages =~ /,/)) { # only one language
return $languages; return $languages;
} }
my @languages = Bugzilla::Template::sortAcceptLanguage($languages); # XXX This should probably be re-worked so that we don't have to
my @accept_language = Bugzilla::Template::sortAcceptLanguage($ENV{'HTTP_ACCEPT_LANGUAGE'} || "" ); # reach into the internals of another module to get languages.
my @languages = Bugzilla::Install::Util::_sort_accept_language($languages);
my @accept_language = Bugzilla::Install::Util::_sort_accept_language(
$ENV{'HTTP_ACCEPT_LANGUAGE'} || "" );
my @usedlanguages; my @usedlanguages;
foreach my $lang (@accept_language) { foreach my $lang (@accept_language) {
if(my @found = grep /^\Q$lang\E(-.+)?$/i, @languages) { if(my @found = grep /^\Q$lang\E(-.+)?$/i, @languages) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment