StringUtils: Clarify that isValidRegex is for PCRE regexps
[lhc/web/wiklou.git] / includes / utils / ZipDirectoryReader.php
index 46f3bbc..4207d41 100644 (file)
@@ -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 );