X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fauth%2FThrottler.php;h=6d3b2f46e64a2e9c2e1992c4faa3cf4494836b12;hb=2c0db8f5e8593a51ae0acc8285fd40b7743b0fce;hp=f47c60655f8c24788323023d8ef008988250f109;hpb=c6bc3b13f8a469c31fbc2a0345ca782002a77dd8;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/auth/Throttler.php b/includes/auth/Throttler.php index f47c60655f..6d3b2f46e6 100644 --- a/includes/auth/Throttler.php +++ b/includes/auth/Throttler.php @@ -23,6 +23,7 @@ namespace MediaWiki\Auth; use BagOStuff; use MediaWiki\Logger\LoggerFactory; +use MediaWiki\MediaWikiServices; use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerInterface; use Psr\Log\LogLevel; @@ -68,7 +69,7 @@ class Throttler implements LoggerAwareInterface { } if ( $conditions === null ) { - $config = \ConfigFactory::getDefaultInstance()->makeConfig( 'main' ); + $config = MediaWikiServices::getInstance()->getMainConfig(); $conditions = $config->get( 'PasswordAttemptThrottle' ); $params += [ 'type' => 'password', @@ -135,7 +136,7 @@ class Throttler implements LoggerAwareInterface { $this->cache->incr( $throttleKey ); } else { // throttled $this->logRejection( [ - 'type' => $this->type, + 'throttle' => $this->type, 'index' => $index, 'ip' => $ipKey, 'username' => $username, @@ -191,7 +192,7 @@ class Throttler implements LoggerAwareInterface { } protected function logRejection( array $context ) { - $logMsg = 'Throttle {type} hit, throttled for {expiry} seconds due to {count} attempts ' + $logMsg = 'Throttle {throttle} hit, throttled for {expiry} seconds due to {count} attempts ' . 'from username {username} and IP {ip}'; // If we are hitting a throttle for >= warningLimit attempts, it is much more likely to be