r49798 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49797‎ | r49798 | r49799 >
Date:07:58, 24 April 2009
Author:werdna
Status:ok
Tags:
Comment:
Fix storage of settings with no defaults -- treat the default as null and do not store if the setting is false or null (but DO store if it is zero)
Modified paths:
  • /trunk/extensions/CentralAuth/CentralAuthUser.php (modified) (history)
  • /trunk/phase3/includes/User.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -3545,7 +3545,8 @@
35463546 return;
35473547
35483548 foreach( $saveOptions as $key => $value ) {
3549 - if ( is_null(self::getDefaultOption($key)) ||
 3549+ if ( ( is_null(self::getDefaultOption($key)) &&
 3550+ !( $value === false || is_null($value) ) ) ||
35503551 $value != self::getDefaultOption( $key ) ) {
35513552 $insert_rows[] = array(
35523553 'up_user' => $this->getId(),
Index: trunk/extensions/CentralAuth/CentralAuthUser.php
@@ -224,7 +224,8 @@
225225
226226 global $wgCentralAuthPropertySaveWhitelist;
227227 foreach( $this->mProperties as $key => $value ) {
228 - if ( is_null(User::getDefaultOption($key)) ||
 228+ if ( ( is_null(User::getDefaultOption($key)) &&
 229+ !( $value === false || is_null($value) ) ) ||
229230 $value != User::getDefaultOption( $key ) ||
230231 in_array( $key, $wgCentralAuthPropertySaveWhitelist ) ) {
231232 $insert_rows[] = array(

Status & tagging log