From: Max Kanat-Alexander Date: Fri, 2 Apr 2010 23:34:46 +0000 (-0700) Subject: Bug 556439: Prevent datetime_from from dying if it gets 0000-00-00 as a X-Git-Tag: bugzilla-3.6~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba9eac649fa8b125fc14449ffe0de190a6ce6756;p=thirdparty%2Fbugzilla.git Bug 556439: Prevent datetime_from from dying if it gets 0000-00-00 as a date from the database r=LpSolit, a=LpSolit --- diff --git a/Bugzilla/Util.pm b/Bugzilla/Util.pm index d03cda0eb8..8442db7da9 100644 --- a/Bugzilla/Util.pm +++ b/Bugzilla/Util.pm @@ -438,6 +438,9 @@ sub format_time { sub datetime_from { my ($date, $timezone) = @_; + # In the database, this is the "0" date. + return undef if $date =~ /^0000/; + # strptime($date) returns an empty array if $date has an invalid # date format. my @time = strptime($date);