Add loadPasswords() calls to User password mutators
[lhc/web/wiklou.git] / 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 = '';