Allow use of +setting to add to that setting as it is (for arrays), rather than to...
authorAndrew Garrett <werdna@users.mediawiki.org>
Mon, 18 Aug 2008 12:50:30 +0000 (12:50 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Mon, 18 Aug 2008 12:50:30 +0000 (12:50 +0000)
includes/SiteConfiguration.php

index 88d4133..ddaaa58 100644 (file)
@@ -178,7 +178,16 @@ class SiteConfiguration {
        function extractGlobal( $setting, $wiki, $suffix, $params, $wikiTags = array() ) {
                $value = $this->get( $setting, $wiki, $suffix, $params, $wikiTags );
                if ( !is_null( $value ) ) {
-                       $GLOBALS[$setting] = $value;
+                       if (substr($setting,0,1) == '+' && is_array($value)) {
+                               $setting = substr($setting,1);
+                               if ( is_array($GLOBALS[$setting]) ) {
+                                       $GLOBALS[$setting] = array_merge( $GLOBALS[$setting], $value );
+                               } else {
+                                       $GLOBALS[$setting] = $value;
+                               }
+                       } else {
+                               $GLOBALS[$setting] = $value;
+                       }
                }
        }