Globally unsuppress phan issues with low count
[lhc/web/wiklou.git] / includes / libs / mime / MSCompoundFileReader.php
index aea0a02..26e9685 100644 (file)
@@ -149,6 +149,7 @@ class MSCompoundFileReader {
                        $this->error( 'invalid signature: ' . bin2hex( $this->header['header_signature'] ),
                                self::ERROR_INVALID_SIGNATURE );
                }
+               // @phan-suppress-next-line PhanTypeInvalidRightOperandOfIntegerOp
                $this->sectorLength = 1 << $this->header['sector_shift'];
                $this->readDifat();
                $this->readDirectory();
@@ -182,11 +183,6 @@ class MSCompoundFileReader {
                return $this->unpack( $block, 0, $struct );
        }
 
-       private function unpackSector( $sectorNumber, $struct ) {
-               $offset = $this->sectorOffset( $sectorNumber );
-               return $this->unpackOffset( $offset, array_sum( $struct ) );
-       }
-
        private function unpack( $block, $offset, $struct ) {
                $data = [];
                foreach ( $struct as $key => $length ) {
@@ -225,6 +221,7 @@ class MSCompoundFileReader {
        }
 
        private function readSector( $sectorId ) {
+               // @phan-suppress-next-line PhanTypeInvalidRightOperandOfIntegerOp
                return $this->readOffset( $this->sectorOffset( $sectorId ), 1 << $this->header['sector_shift'] );
        }
 
@@ -333,7 +330,7 @@ class MSCompoundFileReader {
                                continue;
                        }
 
-                       $name = iconv( 'UTF-16', 'UTF-8', substr( $entry['name_raw'], 0, $entry['name_length'] - 2 ) );
+                       $name = iconv( 'UTF-16LE', 'UTF-8', substr( $entry['name_raw'], 0, $entry['name_length'] - 2 ) );
 
                        $clsid = $this->decodeClsid( $entry['clsid'] );
                        if ( $type == self::TYPE_ROOT && isset( self::$mimesByClsid[$clsid] ) ) {