X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Futils%2FZipDirectoryReader.php;h=4207d4104c8be918ebd2636478c74773fd1705c0;hb=825d66bfa44c5dae2b78e2fe4f3b16f16aff4a12;hp=46f3bbcce727f26cefd6682c7c0daba6b0d8a07d;hpb=5410cfccce9b0b84bc909506c9b66d3f27d6dba7;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/utils/ZipDirectoryReader.php b/includes/utils/ZipDirectoryReader.php index 46f3bbcce7..4207d4104c 100644 --- a/includes/utils/ZipDirectoryReader.php +++ b/includes/utils/ZipDirectoryReader.php @@ -127,7 +127,6 @@ class ZipDirectoryReader { const GENERAL_CD_ENCRYPTED = 13; /** - * Private constructor * @param string $fileName * @param callable $callback * @param array $options @@ -229,7 +228,9 @@ class ZipDirectoryReader { $this->eocdr['EOCDR size'] = $structSize + $this->eocdr['file comment length']; if ( $structSize + $this->eocdr['file comment length'] != strlen( $block ) - $sigPos ) { - $this->error( 'zip-bad', 'trailing bytes after the end of the file comment' ); + // T40432: MS binary documents frequently embed ZIP files + $this->error( 'zip-wrong-format', 'there is a ZIP signature but it is not at ' . + 'the end of the file. It could be an OLE file with a ZIP file embedded.' ); } if ( $this->eocdr['disk'] !== 0 || $this->eocdr['CD start disk'] !== 0 @@ -368,6 +369,7 @@ class ZipDirectoryReader { * Read the central directory at the given location * @param int $offset * @param int $size + * @suppress PhanTypeInvalidLeftOperandOfIntegerOp */ function readCentralDirectory( $offset, $size ) { $block = $this->getBlock( $offset, $size );