ssafronova (ssafronova) wrote in changelog,
ssafronova
ssafronova
changelog

[livejournal] r17675: LJSUP-7328: Month '-1' out of range 0..1...

Committer: ssafronova
LJSUP-7328: Month '-1' out of range 0..11 at /home/lj/cgi-bin/LJ/TimeUtil.pm line 65
U   trunk/cgi-bin/LJ/TimeUtil.pm
Modified: trunk/cgi-bin/LJ/TimeUtil.pm
===================================================================
--- trunk/cgi-bin/LJ/TimeUtil.pm	2010-11-12 09:56:25 UTC (rev 17674)
+++ trunk/cgi-bin/LJ/TimeUtil.pm	2010-11-12 11:09:57 UTC (rev 17675)
@@ -61,6 +61,7 @@
     my ($class, $string, $gmt) = @_;
     return undef unless $string =~ /^(\d\d\d\d)-(\d\d)-(\d\d)(?: (\d\d):(\d\d)(?::(\d\d))?)?$/;
     my ($y, $mon, $d, $h, $min, $s) = ($1, $2, $3, $4, $5, $6);
+    return undef unless ($d + 0) and ($mon + 0); # '00' is string and is true value
     my $calc = sub {
         $gmt ?
             Time::Local::timegm($s, $min, $h, $d, $mon-1, $y) :

Tags: livejournal, pm, ssafronova
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