Correcting array element reference syntax which caused unnecessary warns
Also adding conditional to check ENV VAR definition to avoid unnecssary warns.
This commit is contained in:
parent
2f274f01a1
commit
8a63dd55a0
1 changed files with 7 additions and 5 deletions
|
@ -67,14 +67,16 @@ my $news_lang;
|
|||
if($input->cookie('KohaOpacLanguage')){
|
||||
$news_lang = $input->cookie('KohaOpacLanguage');
|
||||
}else{
|
||||
if ($ENV{HTTP_ACCEPT_LANGUAGE}) {
|
||||
while( !$news_lang && ( $ENV{HTTP_ACCEPT_LANGUAGE} =~ m/([a-zA-Z]{2,}-?[a-zA-Z]*)(;|,)?/g ) ){
|
||||
if( my @lang = grep { /^$1$/i } @languages ) {
|
||||
$news_lang = $lang[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (not $news_lang) {
|
||||
my @languages = split ",", C4::Context->preference("opaclanguages");
|
||||
$news_lang = @languages[0];
|
||||
$news_lang = $languages[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue