diff options
author | lpsolit%gmail.com <> | 2009-02-05 18:37:16 +0000 |
---|---|---|
committer | lpsolit%gmail.com <> | 2009-02-05 18:37:16 +0000 |
commit | 7d01cb036c10487b653fd5a74a64f38093a863c7 (patch) | |
tree | c7544e2a35b69f80455fe5e964dda6c018f9e07f /Bugzilla/Util.pm | |
parent | Bug 476943 - Edit multiple issues token after switching to shadow DB (diff) | |
download | bugzilla-7d01cb036c10487b653fd5a74a64f38093a863c7.tar.gz bugzilla-7d01cb036c10487b653fd5a74a64f38093a863c7.tar.bz2 bugzilla-7d01cb036c10487b653fd5a74a64f38093a863c7.zip |
Bug 476889: importxml.pl crashes when importing bugs (Date::Parse::strptime() leave seconds undefined in some cases) - Patch by Frédéric Buclin <LpSolit@gmail.com> r=ghendricks a=LpSolit
Diffstat (limited to 'Bugzilla/Util.pm')
-rw-r--r-- | Bugzilla/Util.pm | 3 |
1 files changed, 3 insertions, 0 deletions
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], |