diff --git a/inc/class-statifyblacklist-settings.php b/inc/class-statifyblacklist-settings.php index b7c21b2..26e35d3 100644 --- a/inc/class-statifyblacklist-settings.php +++ b/inc/class-statifyblacklist-settings.php @@ -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; diff --git a/inc/class-statifyblacklist-system.php b/inc/class-statifyblacklist-system.php index 87169aa..2cd5473 100644 --- a/inc/class-statifyblacklist-system.php +++ b/inc/class-statifyblacklist-system.php @@ -186,7 +186,7 @@ class StatifyBlacklist_System extends StatifyBlacklist { ); } elseif ( ! isset( $options['ua']['blacklist'] ) ) { $options['ua']['blacklist'] = array(); - } elseif ( isset( $options['ua'] ) ) { + } else { // User agent strings got stored incorrectly in 1.6.0 - luckily the version was not updated, either. $options['ua']['blacklist'] = array_flip( $options['ua']['blacklist'] ); }