From: Thomas Schlage Date: Fri, 31 May 2013 12:54:22 +0000 (+0200) Subject: Fixed ZipWriter getDosDatetime on NaN value X-Git-Tag: 2.0.0_Beta_4~118^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=692d758585c7ce00b2ed3beb889550dd22a61148;p=GitHub%2FWoltLab%2FWCF.git Fixed ZipWriter getDosDatetime on NaN value --- 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);