Merge "Revert "Use display name in category page subheadings if provided""
[lhc/web/wiklou.git] / includes / Block.php
index 098d51c..a11ba26 100644 (file)
@@ -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() );
                        }