Skip to content

Commit e668a2a

Browse files
committed
Improve encrypted zip file detection.
1 parent 21cc199 commit e668a2a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,4 @@ __*Why "v3.0.0" instead of "v1.0.0?"*__ Prior to phpMussel v3, the "phpMussel Co
161161

162162
#### Other changes.
163163
- [2024.11.06]: Added PHP 8.4 to workflows.
164+
- [2024.11.06]: Improved encrypted zip file detection.

src/Scanner.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* License: GNU/GPLv2
99
* @see LICENSE.txt
1010
*
11-
* This file: The scanner (last modified: 2024.10.15).
11+
* This file: The scanner (last modified: 2024.11.06).
1212
*/
1313

1414
namespace phpMussel\Core;
@@ -2860,8 +2860,8 @@ private function archiveRecursor(string $Data, string $File = '', int $ScanDepth
28602860
* @link https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT
28612861
*/
28622862
if ($this->Loader->Configuration['files']['block_encrypted_archives']) {
2863-
$Bits = $this->explodeBits(substr($Data, 6, 2));
2864-
if ($Bits && $Bits[7]) {
2863+
$Bits = $this->explodeBits(substr($Data, 6, 1));
2864+
if ($Bits !== '' && substr($Bits, 7, 1) === '1') {
28652865
$this->atHit($DataHash, $DataLen, $ItemRef, sprintf(
28662866
$this->Loader->L10N->getString('grammar_exclamation_mark'),
28672867
sprintf(

0 commit comments

Comments
 (0)