From 692d758585c7ce00b2ed3beb889550dd22a61148 Mon Sep 17 00:00:00 2001 From: Thomas Schlage Date: Fri, 31 May 2013 14:54:22 +0200 Subject: [PATCH] Fixed ZipWriter getDosDatetime on NaN value --- wcfsetup/install/files/lib/system/io/ZipWriter.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/lib/system/io/ZipWriter.class.php b/wcfsetup/install/files/lib/system/io/ZipWriter.class.php index 18a520a807..0835e79781 100644 --- a/wcfsetup/install/files/lib/system/io/ZipWriter.class.php +++ b/wcfsetup/install/files/lib/system/io/ZipWriter.class.php @@ -174,14 +174,17 @@ class ZipWriter { pack("V", strlen($headers)). "\x00\x00"; } - + /** * Converts an unix timestamp to Zip file time. - * + * * @param integer $date unix timestamp * @return string */ - protected static function getDosDatetime($date = 0) { + protected static function getDosDatetime($date) { + // Ensure we have a numeric value + $date = intval($date); + $day = gmdate('d', $date); $month = gmdate('m', $date); $year = gmdate('Y', $date); -- 2.20.1