From 7d01cb036c10487b653fd5a74a64f38093a863c7 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Thu, 5 Feb 2009 18:37:16 +0000 Subject: Bug 476889: importxml.pl crashes when importing bugs (Date::Parse::strptime() leave seconds undefined in some cases) - Patch by Frédéric Buclin r=ghendricks a=LpSolit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bugzilla/Util.pm | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Bugzilla/Util.pm') diff --git a/Bugzilla/Util.pm b/Bugzilla/Util.pm index 951c4df3c..3573ad148 100644 --- a/Bugzilla/Util.pm +++ b/Bugzilla/Util.pm @@ -444,6 +444,9 @@ sub format_time { my @time = strptime($date); if (scalar @time) { + # Fix a bug in strptime() where seconds can be undefined in some cases. + $time[0] ||= 0; + # strptime() counts years from 1900, and months from 0 (January). # We have to fix both values. my $dt = DateTime->new({year => 1900 + $time[5], -- cgit v1.2.3-24-g4f1b