summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-04-03 01:34:02 +0200
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-04-03 01:34:02 +0200
commit3b351275ab6f8090620234dd2b3ee8a9ef72e599 (patch)
tree4f51d3524f8d10e0f42d7c9d15dc53f11f4c8d7d
parenta9a869f8e20ecfbeafeb8020ad4c1e86b60aa21a (diff)
downloadbugzilla-3b351275ab6f8090620234dd2b3ee8a9ef72e599.tar.gz
bugzilla-3b351275ab6f8090620234dd2b3ee8a9ef72e599.tar.xz
Bug 556439: Prevent datetime_from from dying if it gets 0000-00-00 as a
date from the database r=LpSolit, a=LpSolit
-rw-r--r--Bugzilla/Util.pm3
1 files changed, 3 insertions, 0 deletions
diff --git a/Bugzilla/Util.pm b/Bugzilla/Util.pm
index 35a5c0aea..de67d5a59 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);