From caa4d159d8bd9156ca3193d2e65beb7bd49fb1e6 Mon Sep 17 00:00:00 2001 From: Sascha Greuel Date: Sun, 4 Aug 2013 14:13:42 +0200 Subject: [PATCH] Applied small optimization To prevent redundancy --- wcfsetup/install/files/lib/system/io/ZipWriter.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/system/io/ZipWriter.class.php b/wcfsetup/install/files/lib/system/io/ZipWriter.class.php index ef6ba74dc2..7b02c5ded5 100644 --- a/wcfsetup/install/files/lib/system/io/ZipWriter.class.php +++ b/wcfsetup/install/files/lib/system/io/ZipWriter.class.php @@ -57,7 +57,7 @@ class ZipWriter { $record .= "\x00\x00\x0a\x00"; $record .= "\x00\x00\x00\x00"; //$record .= "\x00\x00\x00\x00"; - $record .= (intval($date) < 315532800 ? "\x00\x00\x00\x00" : $this->getDosDatetime($date)); + $record .= $this->getDosDatetime($date); $record .= pack("V", 0); $record .= pack("V", 0); $record .= pack("V", 0); @@ -131,7 +131,7 @@ class ZipWriter { $record = "\x50\x4b\x01\x02"; $record .= "\x00\x00\x14\x00"; $record .= "\x00\x00\x08\x00"; - $record .= (intval($date) < 315532800 ? "\x00\x00\x00\x00" : $this->getDosDatetime($date)); + $record .= $this->getDosDatetime($date); $record .= pack("V", $crc); $record .= pack("V", $sizeCompressed); $record .= pack("V", $sizeUncompressed); @@ -186,6 +186,10 @@ class ZipWriter { // Ensure we have a numeric value $date = intval($date); + if($date < 315532800) { + return "\x00\x00\x00\x00"; + } + $day = gmdate('d', $date); $month = gmdate('m', $date); $year = gmdate('Y', $date); -- 2.20.1