$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();
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 ) {
}
private function readSector( $sectorId ) {
+ // @phan-suppress-next-line PhanTypeInvalidRightOperandOfIntegerOp
return $this->readOffset( $this->sectorOffset( $sectorId ), 1 << $this->header['sector_shift'] );
}
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] ) ) {