X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FBlock.php;h=a11ba26484874cf20d68eccb70ed8a9fd6c9b0e0;hb=7874fc4bec845ad92960b07e969c65f3c3fe74f2;hp=098d51c808dac4e17427bf8ddd761c7ed19bf97d;hpb=8810d849fc89ca73f0367547ea214c9232ed483a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Block.php b/includes/Block.php index 098d51c808..a11ba26484 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -692,11 +692,13 @@ class Block { public static function isWhitelistedFromAutoblocks( $ip ) { // Try to get the autoblock_whitelist from the cache, as it's faster // than getting the msg raw and explode()'ing it. - $cache = ObjectCache::getMainWANInstance(); + $cache = MediaWikiServices::getInstance()->getMainWANObjectCache(); $lines = $cache->getWithSetCallback( wfMemcKey( 'ipb', 'autoblock', 'whitelist' ), $cache::TTL_DAY, - function () { + function ( $curValue, &$ttl, array &$setOpts ) { + $setOpts += Database::getCacheSetOptions( wfGetDB( DB_REPLICA ) ); + return explode( "\n", wfMessage( 'autoblock_whitelist' )->inContentLanguage()->plain() ); }