r43265 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43264‎ | r43265 | r43266 >
Date:19:20, 6 November 2008
Author:ialex
Status:old
Tags:
Comment:
Fixed a bug in settings merging (introduced in version 0.8.10), settings defined with "+" at the beginning of them were merged with the current one instead of the one defined in DefaultSettings.php
Modified paths:
  • /trunk/extensions/Configure/CHANGELOG (modified) (history)
  • /trunk/extensions/Configure/Configure.obj.php (modified) (history)
  • /trunk/extensions/Configure/Configure.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Configure/Configure.obj.php
@@ -170,13 +170,27 @@
171171 // Hmm, a better solution would be nice!
172172 $savedSettings = $this->settings;
173173 $this->settings = $this->mOldSettings;
 174+ $globalDefaults = $this->getDefaults();
 175+
 176+ $savedGlobals = array();
 177+ foreach( $this->settings as $name => $val ){
 178+ if( substr( $name, 0, 1 ) == '+' ){
 179+ $setting = substr( $name, 1 );
 180+ if( isset( $globalDefaults[$setting] ) ){
 181+ $savedGlobals[$setting] = $GLOBALS[$setting];
 182+ $GLOBALS[$setting] = $globalDefaults[$setting];
 183+ }
 184+ }
 185+ }
174186
175187 $wikiDefaults = $this->getCurrent( $wiki );
176188
177189 $this->settings = $savedSettings;
178190 unset( $savedSettings );
 191+ foreach( $savedGlobals as $name => $val ){
 192+ $GLOBALS[$setting] = $savedGlobals[$setting];
 193+ }
179194
180 - $globalDefaults = $this->getDefaults();
181195 $ret = array();
182196 $keys = array_unique( array_merge( array_keys( $wikiDefaults ), array_keys( $globalDefaults ) ) );
183197 foreach( $keys as $setting ){
Index: trunk/extensions/Configure/CHANGELOG
@@ -1,6 +1,9 @@
22 This file lists changes on this extension.
33 Localisation updates are done on betawiki and aren't listed here.
44
 5+0.9.2 - 6 November 2008
 6+ Fixed a bug in settings merging (introduced in version 0.8.10).
 7+
58 0.9.1 - 5 November 2008
69 * MediaWiki: added $wgAllowUserSkin, $wgDebugLogPrefix, $wgEnotifUseRealName
710 and $wgImageMagickTempDir.
Index: trunk/extensions/Configure/Configure.php
@@ -17,7 +17,7 @@
1818 'url' => 'http://www.mediawiki.org/wiki/Extension:Configure',
1919 'description' => 'Allow authorised users to configure the wiki by a web-based interface',
2020 'descriptionmsg' => 'configure-desc',
21 - 'version' => '0.9.1',
 21+ 'version' => '0.9.2',
2222 );
2323
2424 ## Configuration part

Status & tagging log