Committer: gprochaev
LJSUP-11026: Remove some warnings from log fileU trunk/cgi-bin/LJ/Lang.pm
Modified: trunk/cgi-bin/LJ/Lang.pm =================================================================== --- trunk/cgi-bin/LJ/Lang.pm 2012-01-23 09:26:46 UTC (rev 20953) +++ trunk/cgi-bin/LJ/Lang.pm 2012-01-23 10:04:26 UTC (rev 20954) @@ -598,7 +598,7 @@ my $from_db = sub { my $text = get_text_multi( $lang, $dmid, [$code] ); - return $text->{$code}; + return defined $text->{$code} ? $text->{$code} : undef; }; my $_from_files = sub { @@ -714,7 +714,7 @@ my $text = undef; $text = $TXT_CACHE{$cache_key} unless $LJ::NO_ML_CACHE; - if ( defined $text ) { + if ( defined $text && defined $lc_codes{$code} ) { $strings{ $lc_codes{$code} } = $text; $LJ::_ML_USED_STRINGS{$code} = $text if $LJ::IS_DEV_SERVER; } else { @@ -1059,7 +1059,7 @@ return $code; } - if ( $code =~ /^[.]/ ) { + if ( $code && $code =~ /^[.]/ ) { $code = current_scope() . $code; }