Skip to content

Commit 5ce088f

Browse files
committed
Flag support patch.
Changelog excerpt: - Added support to optionally disable adding new hash cache entries when a specific instance cache flag is used.
1 parent 5c4ca53 commit 5ce088f

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

Changelog.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,13 @@ __*Why "v3.0.0" instead of "v1.0.0?"*__ Prior to phpMussel v3, the "phpMussel Co
3939

4040
### v3.2.1
4141

42-
- [2021.03.11]: Added some missing return type declarations.
43-
4442
#### Bugs fixed.
4543
- [2021.04.19]: BuildPath could potentially trigger warnings when open_basedir is defined, causing logging, among various other internal file operations, to fail (related to PHP bug 69240); Fixed.
4644
- [2021.05.01]: Log truncation not being calculated properly; Fixed.
4745
- [2021.05.28]: Wrong casing used for some variables would cause undefined variable errors to occur; Fixed (#3).
4846

4947
#### Other changes.
48+
- [2021.03.11]: Added some missing return type declarations.
5049
- [2021.05.28]: Performed some minor refactoring.
5150

5251
### v3.3.0
@@ -58,20 +57,22 @@ __*Why "v3.0.0" instead of "v1.0.0?"*__ Prior to phpMussel v3, the "phpMussel Co
5857

5958
### v3.3.1
6059

61-
- [2021.11.27]: At the front-end configuration page, configuration directives relying on specific extensions (specifically, at this time, the supplementary cache options) will now include a notice as to whether the extensions relied upon are available.
62-
6360
#### Bugs fixed.
6461
- [2022.02.01]: Failed to correctly determine the client's IP address under certain circumstances (e.g., multiple choices available via HTTP_X_FORWARDED_FOR); Fixed.
6562

66-
### v3.3.2
63+
#### Other changes.
64+
- [2021.11.27]: At the front-end configuration page, configuration directives relying on specific extensions (specifically, at this time, the supplementary cache options) will now include a notice as to whether the extensions relied upon are available.
6765

68-
- [2022.02.21]: Improved IP address resolution strategy.
69-
- [2022.02.21]: Added a default caching prefix.
66+
### v3.3.2
7067

7168
#### Bugs fixed.
7269
- [2022.03.11]: Shorthand data was quoted, but needed to be defined as literals in order to avoid being unentitised prior to being parsed as regular expression partials, in order to avoid breaking those expressions and potentially triggering fatal errors; Fixed.
7370
- [2022.03.24]: Fixed a bottleneck in the scan process caused by the readFileBlocks method (phpMussel/phpMussel#231).
7471

72+
#### Other changes.
73+
- [2022.02.21]: Improved IP address resolution strategy.
74+
- [2022.02.21]: Added a default caching prefix.
75+
7576
### v3.3.3
7677

7778
#### Bugs fixed.
@@ -139,13 +140,13 @@ __*Why "v3.0.0" instead of "v1.0.0?"*__ Prior to phpMussel v3, the "phpMussel Co
139140

140141
### v3.5.2
141142

142-
- [2024.07.02]: Refactored the `loadL10N` method. Merged zh and zh-TW L10N, and dropped region designations (e.g., CN, TW) in favour of script designations (e.g., Hans, Hant).
143-
144143
#### Bugs fixed.
145144
- [2024.07.13]: If the client-specified language was the same as the configured language, the client-specified preferred variant would be ignored, even if it wasn't the same as the configured preferred variant; Fixed.
146145

147146
#### Other changes.
147+
- [2024.07.02]: Refactored the `loadL10N` method. Merged zh and zh-TW L10N, and dropped region designations (e.g., CN, TW) in favour of script designations (e.g., Hans, Hant).
148148
- [2024.08.06]: Updated the default filetype blacklist (#7).
149149
- [2024.09.02]: Code-style patch.
150150
- [2024.09.10]: Added L10N for Marathi.
151151
- [2024.09.13]: Added L10N for Malayalam.
152+
- [2024.10.15]: Added support to optionally disable adding new hash cache entries when a specific instance cache flag is used.

src/Scanner.php

Lines changed: 3 additions & 2 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.09.02).
11+
* This file: The scanner (last modified: 2024.10.15).
1212
*/
1313

1414
namespace phpMussel\Core;
@@ -1058,6 +1058,7 @@ private function recursor($Files = '', int $Depth = -1): void
10581058

10591059
/** Add hash cache entry here if necessary (e.g., because of encryption). */
10601060
if (
1061+
empty($this->Loader->InstanceCache['wc']) &&
10611062
($InSha256 = hash('sha256', $In)) &&
10621063
($AtInstanceLookupKey = sprintf('%s:%d:%s', $InSha256, strlen($In), $OriginalFilenameClean)) &&
10631064
isset($this->Loader->ScanResultsIntegers[$AtInstanceLookupKey]) &&
@@ -2720,7 +2721,7 @@ private function dataHandler(string $str = '', int $Depth = 0, string $OriginalF
27202721
$this->Loader->Events->fireEvent('afterVirusTotal');
27212722

27222723
/** Add hash cache entry. */
2723-
if (!empty($HashCacheID)) {
2724+
if (empty($this->Loader->InstanceCache['wc']) && !empty($HashCacheID)) {
27242725
/** 0: (int) {-5...2}; 1: Text. */
27252726
$HashCacheEntry = json_encode([
27262727
$this->Loader->ScanResultsIntegers[$AtInstanceLookupKey] ?? 1,

0 commit comments

Comments
 (0)