From fcf251967fd3b943f9eab23239137f5500e67469 Mon Sep 17 00:00:00 2001 From: Stefan Kalscheuer Date: Sun, 17 Sep 2023 15:27:23 +0200 Subject: [PATCH] fix routine to update options without custom changes (#31) array_merge_recursive() results in a misbehavior making arrays from scalar options when current and default values differ. Replcae it by array_replace_recursive() should resolve the issue for now. --- inc/class-statifyblacklist-system.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/class-statifyblacklist-system.php b/inc/class-statifyblacklist-system.php index 64a6fab..5e1a950 100644 --- a/inc/class-statifyblacklist-system.php +++ b/inc/class-statifyblacklist-system.php @@ -205,7 +205,7 @@ class StatifyBlacklist_System extends StatifyBlacklist { // Version older than current major release. if ( self::VERSION_MAIN > self::$options['version'] ) { // Merge default options with current config, assuming only additive changes. - $options = array_merge_recursive( self::default_options(), self::$options ); + $options = array_replace_recursive( self::default_options(), self::$options ); $options['version'] = self::VERSION_MAIN; if ( self::$multisite ) { update_site_option( 'statify-blacklist', $options );