Skip to content

Commit

Permalink
Fixed spbc_scanner_file_send()
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemAnoshin committed Jun 19, 2023
1 parent 7f7d09f commit d01d25e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion inc/spbc-scanner.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ function spbc_scanner_file_send($direct_call = false, $file_id = null)
$file_info['full_hash']
);
$result_heur = $heuristic_scanner->scanFile($file_to_check, $root_path);

if (is_array($result_heur) && ! empty($result_heur['error'])) {
$output = array('error' => 'RESCANNING_FAILED');
if ( !$direct_call ) {
Expand All @@ -260,6 +261,7 @@ function spbc_scanner_file_send($direct_call = false, $file_id = null)
$file_info['full_hash']
);
$result_sign = $signatures_scanner->scanFile($file_to_check, $root_path, $signatures);

if (is_array($result_sign) && ! empty($result_sign['error'])) {
$output = array('error' => 'RESCANNING_FAILED');
if ( !$direct_call ) {
Expand All @@ -268,7 +270,7 @@ function spbc_scanner_file_send($direct_call = false, $file_id = null)
return $output;
}

$mixed_result = Arr::mergeWithSavingNumericKeysRecursive($result_sign->weak_spots, $result_heur->weak_spots);
$mixed_result = Arr::mergeWithSavingNumericKeysRecursive((array)$result_heur, (array)$result_sign);

$wpdb->update(
SPBC_TBL_SCAN_FILES,
Expand Down

0 comments on commit d01d25e

Please sign in to comment.