diff --git a/Changelog.md b/Changelog.md index 684d9e3..d02dbe2 100644 --- a/Changelog.md +++ b/Changelog.md @@ -161,3 +161,4 @@ __*Why "v3.0.0" instead of "v1.0.0?"*__ Prior to phpMussel v3, the "phpMussel Co #### Other changes. - [2024.11.06]: Added PHP 8.4 to workflows. +- [2024.11.06]: Improved encrypted zip file detection. diff --git a/src/Scanner.php b/src/Scanner.php index a4afeae..6376f95 100644 --- a/src/Scanner.php +++ b/src/Scanner.php @@ -8,7 +8,7 @@ * License: GNU/GPLv2 * @see LICENSE.txt * - * This file: The scanner (last modified: 2024.10.15). + * This file: The scanner (last modified: 2024.11.06). */ namespace phpMussel\Core; @@ -2860,8 +2860,8 @@ private function archiveRecursor(string $Data, string $File = '', int $ScanDepth * @link https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT */ if ($this->Loader->Configuration['files']['block_encrypted_archives']) { - $Bits = $this->explodeBits(substr($Data, 6, 2)); - if ($Bits && $Bits[7]) { + $Bits = $this->explodeBits(substr($Data, 6, 1)); + if ($Bits !== '' && substr($Bits, 7, 1) === '1') { $this->atHit($DataHash, $DataLen, $ItemRef, sprintf( $this->Loader->L10N->getString('grammar_exclamation_mark'), sprintf(