/**
* \type{\arrayof{\string}} A list of default user toggles, i.e., boolean user
- * preferences that are displayed by Special:Preferences as checkboxes.
+ * preferences that are displayed by Special:Preferences as checkboxes.
* This list can be extended via the UserToggles hook or by
* $wgContLang::getExtraUserToggles().
* @showinitializer
return 'passwordtooshort';
} elseif ( $wgContLang->lc( $password ) == $wgContLang->lc( $this->mName ) ) {
return 'password-name-match';
+ } else {
+ //it seems weird returning true here, but this is because of the
+ //initialization of $result to false above. If the hook is never run or it
+ //doesn't modify $result, then we will likely get down into this if with
+ //a valid password.
+ return true;
}
} elseif( $result === true ) {
return true;
* - 'creatable' Valid for batch processes, login and account creation
*/
static function getCanonicalName( $name, $validate = 'valid' ) {
- # Maybe force usernames to capital
- $name = Title::capitalize( $name, NS_USER );
+ # Force usernames to capital
+ global $wgContLang;
+ $name = $wgContLang->ucfirst( $name );
# Reject names containing '#'; these will be cleaned up
# with title normalisation, but then it's too late to
$dbw = wfGetDB( DB_MASTER );
$dbw->update( 'watchlist',
array( /* SET */
- 'wl_notificationtimestamp' => NULL
+ 'wl_notificationtimestamp' => null
), array( /* WHERE */
'wl_title' => $title->getDBkey(),
'wl_namespace' => $title->getNamespace(),
$dbw = wfGetDB( DB_MASTER );
$dbw->update( 'watchlist',
array( /* SET */
- 'wl_notificationtimestamp' => NULL
+ 'wl_notificationtimestamp' => null
), array( /* WHERE */
'wl_user' => $currentUser
), __METHOD__
}
protected function loadOptions() {
+ global $wgCookiePrefix;
$this->load();
if ( $this->mOptionsLoaded || !$this->getId() )
return;
$this->mOptionOverrides[$row->up_property] = $row->up_value;
$this->mOptions[$row->up_property] = $row->up_value;
}
+
+ //null skin if User::mId is loaded out of session data without persistant credentials
+ if ( !isset( $_SESSION['wsToken'] ) && !isset( $_COOKIE["{$wgCookiePrefix}Token"] ) )
+ $this->mOptions['skin'] = null;
+
}
$this->mOptionsLoaded = true;