1
0
mirror of https://github.com/Ne-Lexa/php-zip.git synced 2025-10-26 03:26:38 +01:00

zip extra tests, php 32-bit compat

This commit is contained in:
Ne-Lexa
2020-01-14 16:31:22 +03:00
parent d21fdb35bb
commit 8487dac9df
13 changed files with 246 additions and 122 deletions

View File

@@ -963,9 +963,12 @@ class ZipEntry
{
$dosTime = (int) $dosTime;
if ($dosTime < 0x00000000 || $dosTime > 0xffffffff) {
throw new InvalidArgumentException('DosTime out of range');
if (\PHP_INT_SIZE === 8) {
if ($dosTime < 0x00000000 || $dosTime > 0xffffffff) {
throw new InvalidArgumentException('DosTime out of range');
}
}
$this->dosTime = $dosTime;
return $this;
@@ -1010,9 +1013,12 @@ class ZipEntry
{
$this->externalAttributes = (int) $externalAttributes;
if ($externalAttributes < 0x00000000 || $externalAttributes > 0xffffffff) {
throw new InvalidArgumentException('external attributes out of range: ' . $externalAttributes);
if (\PHP_INT_SIZE === 8) {
if ($externalAttributes < 0x00000000 || $externalAttributes > 0xffffffff) {
throw new InvalidArgumentException('external attributes out of range: ' . $externalAttributes);
}
}
$this->externalAttributes = $externalAttributes;
return $this;