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.
This commit is contained in:
Stefan Kalscheuer 2023-09-17 15:27:23 +02:00
parent 3b169b28a7
commit fcf251967f
Signed by: stefan
GPG Key ID: 3887EC2A53B55430

View File

@ -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 );