X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FBlock.php;h=a11ba26484874cf20d68eccb70ed8a9fd6c9b0e0;hb=362be5bb90ec45fddeeeb5f7860b601c114d62ac;hp=098d51c808dac4e17427bf8ddd761c7ed19bf97d;hpb=320e4c56132681f811c2819e3e22e98715f46ae7;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() ); }