From: mkanat%bugzilla.org <> Date: Sat, 18 Aug 2007 05:16:08 +0000 (+0000) Subject: Bug 390756: Hook.pm couldn't find Bugzilla::Template::sortAcceptLanguage, because... X-Git-Tag: bugzilla-3.1.2~63 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae89fa815ac5b6ee314c9f1194179db1c47f5abc;p=thirdparty%2Fbugzilla.git Bug 390756: Hook.pm couldn't find Bugzilla::Template::sortAcceptLanguage, because it didn't exist anymore. Patch By Max Kanat-Alexander r=LpSolit, r=Wurblzap, a=LpSolit --- diff --git a/Bugzilla/Template/Plugin/Hook.pm b/Bugzilla/Template/Plugin/Hook.pm index a5eec820b2..b1f27990ef 100644 --- a/Bugzilla/Template/Plugin/Hook.pm +++ b/Bugzilla/Template/Plugin/Hook.pm @@ -26,6 +26,7 @@ package Bugzilla::Template::Plugin::Hook; use strict; use Bugzilla::Constants; +use Bugzilla::Install::Util; use Bugzilla::Template; use Bugzilla::Util; use Bugzilla::Error; @@ -110,8 +111,11 @@ sub getLanguages() { if (not ($languages =~ /,/)) { # only one language return $languages; } - my @languages = Bugzilla::Template::sortAcceptLanguage($languages); - my @accept_language = Bugzilla::Template::sortAcceptLanguage($ENV{'HTTP_ACCEPT_LANGUAGE'} || "" ); + # XXX This should probably be re-worked so that we don't have to + # 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; foreach my $lang (@accept_language) { if(my @found = grep /^\Q$lang\E(-.+)?$/i, @languages) {