From: umherirrender Date: Sat, 16 Jun 2012 08:16:28 +0000 (+0200) Subject: Use User::getDefaultOption() instead of $wgDefaultUserOptions X-Git-Tag: 1.31.0-rc.0~22987^2 X-Git-Url: http://git.cyclocoop.org/data/%24self?a=commitdiff_plain;h=a36ddc96610bfdfbf7be4f2ac811a348f9c6216e;p=lhc%2Fweb%2Fwiklou.git Use User::getDefaultOption() instead of $wgDefaultUserOptions Using User::getDefaultOption() in User::setOption() sets preferences like 'language' to the right default value, whereas using $wgDefaultOptions sets the language to null because language is not part of $wgDefaultUserOptions, but it is part of return value of User::getDefaultOption(). This only makes problems when reusing the same user object, because when a new user object is created, the value of 'language' is correct. Change-Id: I43a32c66fc3997a4f842c63af374e84d234602b2 --- diff --git a/includes/User.php b/includes/User.php index 5fc0773d6e..3279a389fe 100644 --- a/includes/User.php +++ b/includes/User.php @@ -2288,9 +2288,11 @@ class User { $this->loadOptions(); // Explicitly NULL values should refer to defaults - global $wgDefaultUserOptions; - if( is_null( $val ) && isset( $wgDefaultUserOptions[$oname] ) ) { - $val = $wgDefaultUserOptions[$oname]; + if( is_null( $val ) ) { + $defaultOption = self::getDefaultOption( $oname ); + if( !is_null( $defaultOption ) ) { + $val = $defaultOption; + } } $this->mOptions[$oname] = $val;