diff --git a/lib/CleantalkSP/SpbctWP/Scanner/Frontend.php b/lib/CleantalkSP/SpbctWP/Scanner/Frontend.php index b11b3b553..6ced1b4c6 100644 --- a/lib/CleantalkSP/SpbctWP/Scanner/Frontend.php +++ b/lib/CleantalkSP/SpbctWP/Scanner/Frontend.php @@ -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;