simplify control structures

* extract common parts from if-else branches
* convert redundante elseif to else
This commit is contained in:
2024-03-24 17:39:25 +01:00
parent c88d716dfc
commit 9903a6163d
2 changed files with 5 additions and 6 deletions

View File

@ -8,7 +8,7 @@
* @since 1.7.0
*/
// Quit if accessed directly..
// Quit if accessed directly.
defined( 'ABSPATH' ) || exit;
/**
@ -575,14 +575,13 @@ class StatifyBlacklist_Settings extends StatifyBlacklist {
* @since 1.7.0
*/
private static function sanitize_target_options( &$options ) {
$target_given = $options['blacklist'];
$target_invalid = array();
$target_given = $options['blacklist'];
$target_sanitized = $target_given;
if ( StatifyBlacklist::MODE_REGEX === $options['regexp'] || StatifyBlacklist::MODE_REGEX_CI === $options['regexp'] ) {
$target_sanitized = $target_given;
// Check regular expressions.
$target_invalid = self::sanitize_regex( $target_given );
} else {
$target_sanitized = $target_given;
$target_invalid = array();
}
$options['blacklist'] = $target_sanitized;