Item10267: I18N.pm: Use of uninitialized value in lc
Priority: Normal
Current State: Closed
Released In: 1.1.3
Target Release: patch
Applies To: Engine
Component:
Branches:
In Apache's error_log there are many lines as
> Use of uninitialized value $tag in lc at /var/www/foswiki/lib/Foswiki/I18N.pm line 51.
They occur on navigating to almost any Wiki page until the user switches language in
TopBar's drop down box once.
Another way to prevent it seems to be to define a language in user's preferences like
But then the errors are listed at least until the user logs in.
tools/mailnotify gets the errors as well.
I tested two possible fixes in
I18N.pm:
1) My own one:
sub _normalize_language_tag {
my $tag = shift;
if ( not $tag ) { return '' } # fix
$tag = lc($tag);
2) Or according to
http://foswiki.org/Tasks/Item9151 (
Item9151: use of uninitialised value in lc())
sub _normalize_language_tag {
my $tag = shift;
$tag = lc($tag || '' ); # fix
Now it's much more quiet in error_log.
--
ChristianZiemski - 18 Jan 2011