]> 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:02 +0000 (16:34 -0700)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Fri, 2 Apr 2010 23:34:02 +0000 (16:34 -0700)
date from the database
r=LpSolit, a=LpSolit

Bugzilla/Util.pm

index 35a5c0aea24d7b376ecc8cde5550fc12d8ffb558..de67d5a59d661d271d3a993e2f2110ffd49967ab 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);