X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FUser.php;h=ffe543331e175d42fcca72b90b60dba15ac97143;hb=a4e5e935b6fb3b6e221fb8b3f2daf70b3b756cd0;hp=7998f1b5bec785b2d66366c4f90cf66230ab5797;hpb=b99614119a78547efde71fc57f2fe1a6abda78b6;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/User.php b/includes/User.php index 7998f1b5be..ffe543331e 100644 --- a/includes/User.php +++ b/includes/User.php @@ -44,7 +44,7 @@ class User { /** * \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 @@ -647,6 +647,12 @@ class User { 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; @@ -687,8 +693,9 @@ class User { * - '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 @@ -2320,7 +2327,7 @@ class User { $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(), @@ -2347,7 +2354,7 @@ class User { $dbw = wfGetDB( DB_MASTER ); $dbw->update( 'watchlist', array( /* SET */ - 'wl_notificationtimestamp' => NULL + 'wl_notificationtimestamp' => null ), array( /* WHERE */ 'wl_user' => $currentUser ), __METHOD__ @@ -3569,6 +3576,7 @@ class User { } protected function loadOptions() { + global $wgCookiePrefix; $this->load(); if ( $this->mOptionsLoaded || !$this->getId() ) return; @@ -3597,6 +3605,11 @@ class User { $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;