X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Futils%2FZipDirectoryReader.php;h=212f325cad19ab64b1a29a861d182a7f9b5c2bc2;hb=8357fe9e9836cfd948b89da32f265e5da206c330;hp=44815b47504dd6aaf8b752d0083914b0b4303e06;hpb=96906168cac0e9a7748511b48c369cf22c8406d5;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/utils/ZipDirectoryReader.php b/includes/utils/ZipDirectoryReader.php index 44815b4750..212f325cad 100644 --- a/includes/utils/ZipDirectoryReader.php +++ b/includes/utils/ZipDirectoryReader.php @@ -26,7 +26,6 @@ * * Only a functional interface is provided: ZipFileReader::read(). No access is * given to object instances. - * */ class ZipDirectoryReader { /** @@ -215,6 +214,10 @@ class ZipDirectoryReader { $startPos = 0; } + if ( $this->getFileLength() === 0 ) { + $this->error( 'zip-wrong-format', "The file is empty." ); + } + $block = $this->getBlock( $startPos ); $sigPos = strrpos( $block, "PK\x05\x06" ); if ( $sigPos === false ) {