registration: Fix merging of $wgExtensionCredits
authorKunal Mehta <legoktm@gmail.com>
Mon, 16 Mar 2015 16:47:48 +0000 (09:47 -0700)
committerKunal Mehta <legoktm@gmail.com>
Mon, 16 Mar 2015 16:47:48 +0000 (09:47 -0700)
$wgExtensionCredits has two-levels of arrays, so it needs to be merged
recursively.

Bug: T91609
Change-Id: I4e5fc50059745a89fb69bc1e05a299fd9aaee968

includes/registration/ExtensionRegistry.php

index 5b18e72..52e860c 100644 (file)
@@ -142,8 +142,8 @@ class ExtensionRegistry {
                foreach ( $info['globals'] as $key => $val ) {
                        if ( !isset( $GLOBALS[$key] ) || !$GLOBALS[$key] ) {
                                $GLOBALS[$key] = $val;
-                       } elseif ( $key === 'wgHooks' ) {
-                               // Special case $wgHooks, which requires a recursive merge.
+                       } elseif ( $key === 'wgHooks' || $key === 'wgExtensionCredits' ) {
+                               // Special case $wgHooks and $wgExtensionCredits, which require a recursive merge.
                                // Ideally it would have been taken care of in the first if block though.
                                $GLOBALS[$key] = array_merge_recursive( $GLOBALS[$key], $val );
                        } elseif ( $key === 'wgGroupPermissions' ) {