]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 556439: Prevent datetime_from from dying if it gets 0000-00-00 as a
authorMax Kanat-Alexander <mkanat@bugzilla.org>
Fri, 2 Apr 2010 23:34:46 +0000 (16:34 -0700)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Fri, 2 Apr 2010 23:34:46 +0000 (16:34 -0700)
date from the database
r=LpSolit, a=LpSolit

Bugzilla/Util.pm

index d03cda0eb88a039ed5a001a79c7dfb230130ee79..8442db7da97db153da24465d22438b154eed6442 100644 (file)
@@ -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);