Add loadPasswords() calls to User password mutators
authorTyler Romeo <tylerromeo@gmail.com>
Mon, 4 Aug 2014 15:10:01 +0000 (11:10 -0400)
committerTyler Romeo <tylerromeo@gmail.com>
Mon, 4 Aug 2014 15:10:01 +0000 (11:10 -0400)
In User::setPassword() and User::setNewpassword(), added
calls to loadPasswords() so that the passwords are not
overridden when they are eventually actually loaded.

Bug: 69102
Change-Id: I0b881986323051abed7d1af816eae9eafdbd6782

includes/User.php

index 7edd93e..fe41187 100644 (file)
@@ -2294,6 +2294,8 @@ class User implements IDBAccessObject {
        public function setPassword( $str ) {
                global $wgAuth;
 
+               $this->loadPasswords();
+
                if ( $str !== null ) {
                        if ( !$wgAuth->allowPasswordChange() ) {
                                throw new PasswordError( wfMessage( 'password-change-forbidden' )->text() );
@@ -2380,7 +2382,7 @@ class User implements IDBAccessObject {
         * @param bool $throttle If true, reset the throttle timestamp to the present
         */
        public function setNewpassword( $str, $throttle = true ) {
-               $this->load();
+               $this->loadPasswords();
 
                if ( $str === null ) {
                        $this->mNewpassword = '';