wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[livejournal] r20954: LJSUP-11026: Remove some warnings from l...

Committer: gprochaev
LJSUP-11026: Remove some warnings from log file

U   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;
     }
 

Tags: gprochaev, livejournal, pm, wisest-owl
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments