Feature #4 Regular expression filters

This commit is contained in:
2016-10-09 17:59:30 +02:00
parent e80040fb7e
commit 25b16746b2
6 changed files with 85 additions and 31 deletions

View File

@ -80,7 +80,8 @@ class StatifyBlacklist_System extends StatifyBlacklist {
* @param object $upgrader Upgrader object (unused)
* @param array $options Options array
*
* @since 1.2.0
* @since 1.2.0
* @changed 1.3.0
*/
public static function upgrade() {
self::update_options();
@ -95,5 +96,16 @@ class StatifyBlacklist_System extends StatifyBlacklist {
update_option( 'statify-blacklist', $options );
}
}
/* Check if regular expressions option exists (pre 1.3.0) */
if ( isset( self::$_options['referer_regexp'] ) ) {
$options = self::$_options;
$options['referer_regexp'] = 0;
if ( ( is_multisite() && array_key_exists( STATIFYBLACKLIST_BASE, (array) get_site_option( 'active_sitewide_plugins' ) ) ) ) {
update_site_option( 'statify-blacklist', $options );
} else {
update_option( 'statify-blacklist', $options );
}
}
}
}