mirror of
https://github.com/Ne-Lexa/php-zip.git
synced 2025-03-21 06:59:40 +01:00
Merge branch 'hotfix/3.0.3'
This commit is contained in:
commit
42c0fc59df
@ -1,9 +0,0 @@
|
||||
engines:
|
||||
duplication:
|
||||
enabled: true
|
||||
config:
|
||||
languages:
|
||||
- php
|
||||
exclude_paths:
|
||||
- tests/
|
||||
- vendor/
|
10
.travis.yml
10
.travis.yml
@ -12,10 +12,6 @@ cache:
|
||||
- vendor
|
||||
- $HOME/.composer/cache
|
||||
|
||||
addons:
|
||||
code_climate:
|
||||
repo_token: 486a09d58d663450146c53c81c6c64938bcf3bb0b7c8ddebdc125fe97c18213a
|
||||
|
||||
install:
|
||||
- travis_retry composer self-update && composer --version
|
||||
- travis_retry composer install --prefer-dist --no-interaction
|
||||
@ -25,8 +21,4 @@ before_script:
|
||||
|
||||
script:
|
||||
- composer validate --no-check-lock
|
||||
- vendor/bin/phpunit -v -c bootstrap.xml --coverage-clover build/logs/clover.xml
|
||||
|
||||
after_success:
|
||||
- vendor/bin/test-reporter
|
||||
|
||||
- vendor/bin/phpunit -v -c bootstrap.xml
|
||||
|
@ -1,3 +1,6 @@
|
||||
## 3.0.3 (2017-11-11)
|
||||
Fix bug issue #8 - Error if the file is empty.
|
||||
|
||||
## 3.0.0 (2017-03-15)
|
||||
Merge `ZipOutputFile` with ZipFile and optimize the zip archive update.
|
||||
|
||||
|
@ -6,7 +6,6 @@
|
||||
[](https://packagist.org/packages/nelexa/zip)
|
||||
[](https://packagist.org/packages/nelexa/zip)
|
||||
[](https://php.net/)
|
||||
[](https://codeclimate.com/github/Ne-Lexa/php-zip/coverage)
|
||||
[](https://packagist.org/packages/nelexa/zip)
|
||||
|
||||
Table of contents
|
||||
|
@ -151,7 +151,10 @@ class ZipReadEntry extends ZipAbstractEntry
|
||||
fseek($this->inputStream, $pos);
|
||||
|
||||
// Get raw entry content
|
||||
$content = fread($this->inputStream, $this->getCompressedSize());
|
||||
$content = '';
|
||||
if ($this->getCompressedSize() > 0) {
|
||||
$content = fread($this->inputStream, $this->getCompressedSize());
|
||||
}
|
||||
|
||||
// Strong Encryption Specification - WinZip AES
|
||||
if ($this->isEncrypted()) {
|
||||
|
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace PhpZip;
|
||||
|
||||
use PhpZip\Exception\ZipAuthenticationException;
|
||||
@ -1811,6 +1812,19 @@ class ZipFileTest extends ZipTestCase
|
||||
self::assertTrue($result);
|
||||
}
|
||||
|
||||
public function testEmptyContents()
|
||||
{
|
||||
$zipFile = new ZipFile();
|
||||
$contents = '';
|
||||
$zipFile->addFromString('file', $contents);
|
||||
$zipFile->saveAsFile($this->outputFilename);
|
||||
$zipFile->close();
|
||||
|
||||
$zipFile->openFile($this->outputFilename);
|
||||
self::assertEquals($zipFile['file'], $contents);
|
||||
$zipFile->close();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test support ZIP64 ext (slow test - normal).
|
||||
* Create > 65535 files in archive and open and extract to /dev/null.
|
||||
|
Loading…
x
Reference in New Issue
Block a user