X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fauth%2FThrottler.php;h=6d3b2f46e64a2e9c2e1992c4faa3cf4494836b12;hp=f47c60655f8c24788323023d8ef008988250f109;hb=ce079cf6ad79ca8d3360817f809b219d166f9153;hpb=b86ef89dd17f51841a220e8ef9b3b8b2402e2547 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