Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update approach to align with scan status class
  • Loading branch information
dkmyta committed Dec 10, 2024
commit ab8cda0dfcb5c95ef20d338ef9d3766c91d32180
7 changes: 2 additions & 5 deletions projects/plugins/protect/src/class-scan-history.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,8 @@ private static function normalize_api_data( $scan_data ) {
}

foreach ( $scan_data->threats as $source_threat ) {
if ( isset( $source_threat->extension ) && isset( $source_threat->extension->type ) ) {
$type = $source_threat->extension->type;
if ( 'plugin' === $type || 'theme' === $type ) {
$source_threat->extension->type = $type . 's';
}
if ( ! empty( $source_threat->extension ) && in_array( $source_threat->extension->type, array( 'plugin', 'theme' ), true ) ) {
$source_threat->extension->type .= 's';
}

$history->threats[] = new Threat_Model( $source_threat );
Expand Down
Loading