r47034 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47033‎ | r47034 | r47035 >
Date:12:59, 9 February 2009
Author:ialex
Status:deferred
Tags:
Comment:
(bug 17403) Boolean settings set to false when the default value is true is now properly recognised
Modified paths:
  • /trunk/extensions/Configure/CHANGELOG (modified) (history)
  • /trunk/extensions/Configure/Configure.page.php (modified) (history)
  • /trunk/extensions/Configure/Configure.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Configure/Configure.page.php
@@ -699,7 +699,7 @@
700700 }
701701
702702 if ( array_key_exists( $name, $settings ) ) {
703 - $settings[$name] = $this->cleanupSetting( $name, $settings[$name] );
 703+ $settings[$name] = $this->cleanupSetting( $name, $settings[$name], $type );
704704 if ( $settings[$name] === null )
705705 unset( $settings[$name] );
706706 }
@@ -715,10 +715,10 @@
716716 * @param $val Mixed: setting value
717717 * @return Mixed
718718 */
719 - protected function cleanupSetting( $name, $val ) {
 719+ protected function cleanupSetting( $name, $val, $type ) {
720720 global $wgConf;
721721
722 - if (!empty($val) || $val) {
 722+ if ( !empty( $val ) || $val || $type == 'bool' ) {
723723 return $val;
724724 }
725725
@@ -727,7 +727,7 @@
728728 $list = $this->mConfSettings->getEmptyValues();
729729
730730 static $defaults = null;
731 - if ($defaults === null)
 731+ if ( $defaults === null )
732732 $defaults = $wgConf->getDefaultsForWiki( $this->mWiki );
733733
734734 if ( array_key_exists( $name, $list ) ) {
Index: trunk/extensions/Configure/CHANGELOG
@@ -1,6 +1,10 @@
22 This file lists changes on this extension.
33 Localisation updates are done on betawiki and aren't listed here.
44
 5+0.12.2 - 9 February 2009
 6+ (bug 17403) Boolean settings set to false when the default value is true is
 7+ now properly recognised.
 8+
59 0.12.1 - 7 February 2009
610 * Updated AbuseFilter and FlaggedRevs extensions
711 * Removed obsolete extensions DeletedContributions, LinkSearch and Newuserlog
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 via a web-based interface',
2020 'descriptionmsg' => 'configure-desc',
21 - 'version' => '0.12.1',
 21+ 'version' => '0.12.2',
2222 );
2323
2424 # Configuration part

Status & tagging log