From: Max Kanat-Alexander Date: Fri, 2 Apr 2010 23:34:02 +0000 (-0700) Subject: Bug 556439: Prevent datetime_from from dying if it gets 0000-00-00 as a X-Git-Tag: bugzilla-3.7.1~135 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b351275ab6f8090620234dd2b3ee8a9ef72e599;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 35a5c0aea2..de67d5a59d 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);