Skip to content

Commit

Permalink
Merge branch 'scan-front-show-all-malwares' into dev
Browse files Browse the repository at this point in the history
Upd. Scan. Find and show all malwares in Frontend Malware accordion.
  • Loading branch information
svfcode committed Aug 25, 2023
2 parents 9639d84 + 69735b1 commit af5c78a
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions lib/CleantalkSP/SpbctWP/Scanner/Frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,11 +316,26 @@ public function check()

$page['bad'] = $results ? true : $page['bad'];

$page['found']['redirects'] = 0;
$page['found']['dbd'] = 0;
$page['found']['signatures'] = 0;
$page['found']['csrf'] = 0;

foreach ( $results as $result ) {
$page['found']['redirects'] = $result->type === 'redirects' ? 1 : 0;
$page['found']['dbd'] = $result->type === 'dbd' ? 1 : 0;
$page['found']['signatures'] = $result->type === 'signatures' ? 1 : 0;
$page['found']['csrf'] = $result->type === 'csrf' ? 1 : 0;
switch ($result->type) {
case 'redirects':
$page['found']['redirects'] = 1;
break;
case 'dbd':
$page['found']['dbd'] = 1;
break;
case 'signatures':
$page['found']['signatures'] = 1;
break;
case 'csrf':
$page['found']['csrf'] = 1;
break;
}

$page['found']['line'] = $result->line;
$page['found']['needle'] = $result->needle;
Expand Down

0 comments on commit af5c78a

Please sign in to comment.