Foswiki on GitHub is open for business! Next release meeting: Monday September 15, 1300Z

Item10267: I18N.pm: Use of uninitialized value in lc

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Normal Closed Engine    
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
  • Set LANGUAGE = de

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

 

ItemTemplate edit

Summary I18N.pm: Use of uninitialized value in lc
ReportedBy ChristianZiemski
Codebase 1.1.2, trunk
SVN Range
AppliesTo Engine
Component
Priority Normal
CurrentState Closed
WaitingFor
Checkins Foswikirev:10855 Foswikirev:10856
TargetRelease patch
ReleasedIn 1.1.3
Topic revision: r5 - 16 Apr 2011, KennethLavrsen
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License