r49491 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49490‎ | r49491 | r49492 >
Date:04:07, 15 April 2009
Author:werdna
Status:deferred
Tags:
Comment:
Always save language and variant, even if they match the default
Modified paths:
  • /branches/preferences-work/extensions/CentralAuth/CentralAuth.php (modified) (history)
  • /branches/preferences-work/extensions/CentralAuth/CentralAuthUser.php (modified) (history)

Diff [purge]

Index: branches/preferences-work/extensions/CentralAuth/CentralAuthUser.php
@@ -222,9 +222,11 @@
223223
224224 $insert_rows = array();
225225
 226+ global $wgCentralAuthPropertySaveWhitelist;
226227 foreach( $this->mProperties as $key => $value ) {
227228 if ( is_null(User::getDefaultOption($key)) ||
228 - $value != User::getDefaultOption( $key ) ) {
 229+ $value != User::getDefaultOption( $key ) ||
 230+ in_array( $key, $wgCentralAuthPropertySaveWhitelist ) ) {
229231 $ser = serialize($value);
230232 $insert_rows[] = array(
231233 'gp_user' => $this->getId(),
Index: branches/preferences-work/extensions/CentralAuth/CentralAuth.php
@@ -128,6 +128,12 @@
129129 $wgCentralAuthUDPAddress = false;
130130 $wgCentralAuthNew2UDPPrefix = '';
131131
 132+/** Settings which will always be saved to the DB, regardless of whether or not they
 133+ * match the local default. This should be mainly settings whose defaults change per-wiki.
 134+ */
 135+$wgCentralAuthPropertySaveWhitelist =
 136+ array( 'language', 'variant' );
 137+
132138 /**
133139 * Initialization of the autoloaders, and special extension pages.
134140 */

Status & tagging log