From 183274d6da5b22aff6e72c921fc7fa95028b172d Mon Sep 17 00:00:00 2001 From: Ne-Lexa Date: Mon, 19 Jun 2017 00:44:00 +0300 Subject: [PATCH 1/2] remove build on hhvm --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bc35c18..6ee971a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,6 @@ php: - '5.6' - '7.0' - '7.1' - - hhvm - nightly # cache vendor dirs From 115dfd3b528b84bd43b4073cc566668e9a15c297 Mon Sep 17 00:00:00 2001 From: wapplay-home-linux Date: Mon, 30 Oct 2017 23:31:39 +0300 Subject: [PATCH 2/2] some bugs fixed for php 32-bit --- composer.json | 2 +- src/PhpZip/Model/Entry/ZipAbstractEntry.php | 7 +++++++ src/PhpZip/Model/Entry/ZipNewEntry.php | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 16e73ed..d5e6dc6 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ ], "minimum-stability": "stable", "require": { - "php-64bit": "^5.5 || ^7.0" + "php": "^5.5 || ^7.0" }, "autoload": { "psr-4": { diff --git a/src/PhpZip/Model/Entry/ZipAbstractEntry.php b/src/PhpZip/Model/Entry/ZipAbstractEntry.php index 172b116..17f8d24 100644 --- a/src/PhpZip/Model/Entry/ZipAbstractEntry.php +++ b/src/PhpZip/Model/Entry/ZipAbstractEntry.php @@ -1,4 +1,5 @@ $compressedSize || $compressedSize > 0x7fffffffffffffff) { throw new ZipException("Compressed size out of range - " . $this->name); } @@ -285,6 +287,7 @@ abstract class ZipAbstractEntry implements ZipEntry public function setSize($size) { if (self::UNKNOWN != $size) { + $size = sprintf('%u', $size); if (0 > $size || $size > 0x7fffffffffffffff) { throw new ZipException("Uncompressed Size out of range - " . $this->name); } @@ -310,6 +313,7 @@ abstract class ZipAbstractEntry implements ZipEntry */ public function setOffset($offset) { + $offset = sprintf('%u', $offset); if (0 > $offset || $offset > 0x7fffffffffffffff) { throw new ZipException("Offset out of range - " . $this->name); } @@ -523,6 +527,7 @@ abstract class ZipAbstractEntry implements ZipEntry */ public function setDosTime($dosTime) { + $dosTime = sprintf('%u', $dosTime); if (0x00000000 > $dosTime || $dosTime > 0xffffffff) { throw new ZipException('DosTime out of range'); } @@ -554,6 +559,7 @@ abstract class ZipAbstractEntry implements ZipEntry { $known = self::UNKNOWN != $externalAttributes; if ($known) { + $externalAttributes = sprintf('%u', $externalAttributes); if (0x00000000 > $externalAttributes || $externalAttributes > 0xffffffff) { throw new ZipException("external file attributes out of range - " . $this->name); } @@ -847,6 +853,7 @@ abstract class ZipAbstractEntry implements ZipEntry */ public function setCrc($crc) { + $crc = sprintf('%u', $crc); if (0x00000000 > $crc || $crc > 0xffffffff) { throw new ZipException("CRC-32 out of range - " . $this->name); } diff --git a/src/PhpZip/Model/Entry/ZipNewEntry.php b/src/PhpZip/Model/Entry/ZipNewEntry.php index 25d3e00..0fa5b35 100644 --- a/src/PhpZip/Model/Entry/ZipNewEntry.php +++ b/src/PhpZip/Model/Entry/ZipNewEntry.php @@ -258,7 +258,7 @@ abstract class ZipNewEntry extends ZipAbstractEntry } else { fwrite($outputStream, pack('VV', $this->getCompressedSize(), $this->getSize())); } - } elseif ($this->getCompressedSize() !== $compressedSize) { + } elseif ($this->getCompressedSize() != $compressedSize) { throw new ZipException($this->getName() . " (expected compressed entry size of " . $this->getCompressedSize() . " bytes, but is actually " . $compressedSize . " bytes)");