From 969f3bf3ec9607ea13d18c48bd26adcf7314f8fd Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 19 Aug 2008 19:05:23 +0000 Subject: [PATCH] Revert r39623 "Use array_merge_recursive instead of array_merge for merging settings." I do not think array_merge_recursive does what you think it does. It looks like it would spectacularly corrupt things. --- includes/SiteConfiguration.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/SiteConfiguration.php b/includes/SiteConfiguration.php index 77885f2728..0ed768791c 100644 --- a/includes/SiteConfiguration.php +++ b/includes/SiteConfiguration.php @@ -47,7 +47,7 @@ class SiteConfiguration { foreach ( $wikiTags as $tag ) { if ( array_key_exists( $tag, $thisSetting ) ) { if ( isset($retval) && is_array($retval) && is_array($thisSetting[$tag]) ) { - $retval = array_merge_recursive( $retval, $thisSetting[$tag] ); + $retval = array_merge( $retval, $thisSetting[$tag] ); } else { $retval = $thisSetting[$tag]; } @@ -55,14 +55,14 @@ class SiteConfiguration { } elseif ( array_key_exists( "+$tag", $thisSetting ) && is_array($thisSetting["+$tag"]) ) { if (!isset($retval)) $retval = array(); - $retval = array_merge_recursive( $retval, $thisSetting["+$tag"] ); + $retval = array_merge( $retval, $thisSetting["+$tag"] ); } } // Do suffix settings if ( array_key_exists( $suffix, $thisSetting ) ) { if ( isset($retval) && is_array($retval) && is_array($thisSetting[$suffix]) ) { - $retval = array_merge_recursive( $retval, $thisSetting[$suffix] ); + $retval = array_merge( $retval, $thisSetting[$suffix] ); } else { $retval = $thisSetting[$suffix]; } @@ -70,13 +70,13 @@ class SiteConfiguration { } elseif ( array_key_exists( "+$suffix", $thisSetting ) && is_array($thisSetting["+$suffix"]) ) { if (!isset($retval)) $retval = array(); - $retval = array_merge_recursive( $retval, $thisSetting["+$suffix"] ); + $retval = array_merge( $retval, $thisSetting["+$suffix"] ); } // Fall back to default. if ( array_key_exists( 'default', $thisSetting ) ) { if ( isset($retval) && is_array($retval) && is_array($thisSetting['default']) ) { - $retval = array_merge_recursive( $retval, $thisSetting['default'] ); + $retval = array_merge( $retval, $thisSetting['default'] ); } else { $retval = $thisSetting['default']; } @@ -181,7 +181,7 @@ class SiteConfiguration { if (substr($setting,0,1) == '+' && is_array($value)) { $setting = substr($setting,1); if ( is_array($GLOBALS[$setting]) ) { - $GLOBALS[$setting] = array_merge_recursive( $GLOBALS[$setting], $value ); + $GLOBALS[$setting] = array_merge( $GLOBALS[$setting], $value ); } else { $GLOBALS[$setting] = $value; } -- 2.20.1