Skip to content

Commit

Permalink
Adds check for no defined php or js rules.
Browse files Browse the repository at this point in the history
  • Loading branch information
matt committed Dec 19, 2023
1 parent 6867504 commit a113199
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions includes/validate.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,16 @@ function edac_remove_corrected_posts( $post_ID, $type, $pre = 1, $ruleset = 'php
}
}

if ( 'php' === $ruleset && 0 === count( $php_rule_ids ) ) {
// There are no php rules defined.
return;
}

if ( 'js' === $ruleset && 0 === count( $js_rule_ids ) ) {
// There are no js rules defined.
return;
}

// Build a sql sanitized list from an array
// See: https://stackoverflow.com/questions/10634058/wordpress-prepared-statement-with-in-condition .
$js_rule_ids = array_map(
Expand Down

0 comments on commit a113199

Please sign in to comment.