8
8
* License: GNU/GPLv2
9
9
* @see LICENSE.txt
10
10
*
11
- * This file: The scanner (last modified: 2022.06.19 ).
11
+ * This file: The scanner (last modified: 2022.08.20 ).
12
12
*/
13
13
14
14
namespace phpMussel \Core ;
@@ -885,13 +885,11 @@ private function recursor($Files = '', int $Depth = -1): void
885
885
* only bother doing this if the file hasn't already been flagged though.
886
886
*/
887
887
if (!empty ($ this ->Loader ->InstanceCache ['CheckWasLast ' ])) {
888
-
889
888
/** Create a new compression object. */
890
889
$ CompressionObject = new CompressionHandler ($ In );
891
890
892
891
/** Now we'll try to decompress the file. */
893
892
if (!$ CompressionResults = $ CompressionObject ->TryEverything ()) {
894
-
895
893
/** Success! Now we'll send it to the data handler. */
896
894
$ this ->dataHandler ($ CompressionObject ->Data , $ Depth , $ this ->dropTrailingCompressionExtension ($ OriginalFilenameClean ));
897
895
@@ -910,7 +908,6 @@ private function recursor($Files = '', int $Depth = -1): void
910
908
911
909
/** Executed if any problems were detected. */
912
910
if (empty ($ this ->Loader ->InstanceCache ['CheckWasLast ' ])) {
913
-
914
911
/** Quarantine if necessary. */
915
912
if (
916
913
$ this ->Loader ->Configuration ['quarantine ' ]['quarantine_key ' ] &&
@@ -1736,7 +1733,6 @@ private function dataHandler(string $str = '', int $Depth = 0, string $OriginalF
1736
1733
['URL_Scanner ' , 4 ],
1737
1734
['Complex_Extended ' , 5 ]
1738
1735
] as $ ThisConf ) {
1739
-
1740
1736
/** Fire event: "beforeSigFiles". */
1741
1737
$ this ->Loader ->Events ->fireEvent ('beforeSigFiles ' );
1742
1738
@@ -2338,7 +2334,6 @@ private function dataHandler(string $str = '', int $Depth = 0, string $OriginalF
2338
2334
) ? array_chunk ($ URLScanner ['URLParts ' ], 500 ) : [$ URLScanner ['URLParts ' ]];
2339
2335
$ URLScanner ['URLChunks ' ] = count ($ URLScanner ['URLsChunked ' ]);
2340
2336
for ($ i = 0 ; $ i < $ URLScanner ['URLChunks ' ]; $ i ++) {
2341
-
2342
2337
/** Maximum API lookups reached; abort accordingly. */
2343
2338
if (
2344
2339
$ this ->Loader ->Configuration ['urlscanner ' ]['maximum_api_lookups ' ] > 0 &&
@@ -3489,7 +3484,6 @@ private function safeBrowseLookup(array $URLs, array $URLsNoLookup = [], array $
3489
3484
3490
3485
/** If this lookup has already been performed, return the results. */
3491
3486
if (!empty ($ Response )) {
3492
-
3493
3487
/** Potentially harmful URL detected. */
3494
3488
if ($ Response === '200 ' ) {
3495
3489
return 200 ;
@@ -3537,13 +3531,11 @@ private function safeBrowseLookup(array $URLs, array $URLsNoLookup = [], array $
3537
3531
if (strpos ($ Response , '"matches": ' ) !== false ) {
3538
3532
$ returnVal = 200 ;
3539
3533
} else {
3540
-
3541
3534
/**
3542
3535
* Other possible problem detected.
3543
3536
* @link https://developers.google.com/safe-browsing/v4/status-codes
3544
3537
*/
3545
3538
if (isset ($ this ->Loader ->MostRecentHttpCode ) && $ this ->Loader ->MostRecentHttpCode !== 200 ) {
3546
-
3547
3539
/**
3548
3540
* Malformed request detected (e.g., invalid argument, invalid
3549
3541
* request payload, etc).
@@ -3586,7 +3578,6 @@ private function safeBrowseLookup(array $URLs, array $URLsNoLookup = [], array $
3586
3578
*/
3587
3579
$ newExpiry += 86400 ;
3588
3580
} else {
3589
-
3590
3581
/** Potentially harmful URL *NOT* detected, and no other problems detected. */
3591
3582
$ returnVal = 204 ;
3592
3583
}
@@ -3851,13 +3842,11 @@ private function metaDataScan(string $ItemRef, string $Filename, string &$Data,
3851
3842
* only bother doing this if the file hasn't already been flagged though.
3852
3843
*/
3853
3844
if (!empty ($ this ->Loader ->InstanceCache ['CheckWasLast ' ])) {
3854
-
3855
3845
/** Create a new compression object. */
3856
3846
$ CompressionObject = new CompressionHandler ($ Data );
3857
3847
3858
3848
/** Now we'll try to decompress the file. */
3859
3849
if (!$ CompressionResults = $ CompressionObject ->TryEverything ()) {
3860
-
3861
3850
/** Success! Now we'll send it to the data handler. */
3862
3851
$ this ->dataHandler ($ CompressionObject ->Data , $ Depth , $ this ->dropTrailingCompressionExtension ($ Filename ));
3863
3852
0 commit comments