Merge "Type hint against LinkTarget in WatchedItemStore"
[lhc/web/wiklou.git] / includes / user / BotPassword.php
index b83c209..df5edef 100644 (file)
@@ -21,7 +21,7 @@
 use MediaWiki\Auth\AuthenticationResponse;
 use MediaWiki\MediaWikiServices;
 use MediaWiki\Session\BotPasswordSessionProvider;
-use Wikimedia\Rdbms\IMaintainableDatabase;
+use Wikimedia\Rdbms\IDatabase;
 
 /**
  * Utility class for bot passwords
@@ -71,7 +71,7 @@ class BotPassword implements IDBAccessObject {
        /**
         * Get a database connection for the bot passwords database
         * @param int $db Index of the connection to get, e.g. DB_MASTER or DB_REPLICA.
-        * @return IMaintainableDatabase
+        * @return IDatabase
         */
        public static function getDB( $db ) {
                global $wgBotPasswordsCluster, $wgBotPasswordsDatabase;
@@ -473,7 +473,6 @@ class BotPassword implements IDBAccessObject {
                        return Status::newFatal( 'botpasswords-locked' );
                }
 
-               // Throttle
                $throttle = null;
                if ( !empty( $wgPasswordAttemptThrottle ) ) {
                        $throttle = new MediaWiki\Auth\Throttler( $wgPasswordAttemptThrottle, [
@@ -506,7 +505,7 @@ class BotPassword implements IDBAccessObject {
                        return self::loginHook( $user, $bp,
                                Status::newFatal( 'botpasswords-needs-reset', $name, $appId ) );
                }
-               if ( !$passwordObj->equals( $password ) ) {
+               if ( !$passwordObj->verify( $password ) ) {
                        return self::loginHook( $user, $bp, Status::newFatal( 'wrongpassword' ) );
                }