X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Finterwiki%2FClassicInterwikiLookup.php;h=7a8e64f5cea5104e7993b73c72fd3f080f840ef0;hb=9c7f6734c397a954b8eaa5ec73876f2b4bf92afb;hp=cdf4cde6185749a9c01ab4dda9bb5f4702e42812;hpb=95bbac065507e69b1cbfbdd38b0a3b55eadc1a4c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/interwiki/ClassicInterwikiLookup.php b/includes/interwiki/ClassicInterwikiLookup.php index cdf4cde618..7a8e64f5ce 100644 --- a/includes/interwiki/ClassicInterwikiLookup.php +++ b/includes/interwiki/ClassicInterwikiLookup.php @@ -27,6 +27,7 @@ use Cdb\Reader as CdbReader; use Hooks; use Interwiki; use Language; +use WikiMap; use MapCacheLRU; use WANObjectCache; use Wikimedia\Rdbms\Database; @@ -212,17 +213,20 @@ class ClassicInterwikiLookup implements InterwikiLookup { */ private function getInterwikiCacheEntry( $prefix ) { wfDebug( __METHOD__ . "( $prefix )\n" ); + + $wikiId = WikiMap::getWikiIdFromDbDomain( WikiMap::getCurrentWikiDbDomain() ); + $value = false; try { // Resolve site name if ( $this->interwikiScopes >= 3 && !$this->thisSite ) { - $this->thisSite = $this->getCacheValue( '__sites:' . wfWikiID() ); + $this->thisSite = $this->getCacheValue( '__sites:' . $wikiId ); if ( $this->thisSite == '' ) { $this->thisSite = $this->fallbackSite; } } - $value = $this->getCacheValue( wfWikiID() . ':' . $prefix ); + $value = $this->getCacheValue( $wikiId . ':' . $prefix ); // Site level if ( $value == '' && $this->interwikiScopes >= 3 ) { $value = $this->getCacheValue( "_{$this->thisSite}:{$prefix}" ); @@ -334,11 +338,14 @@ class ClassicInterwikiLookup implements InterwikiLookup { */ private function getAllPrefixesCached( $local ) { wfDebug( __METHOD__ . "()\n" ); + + $wikiId = WikiMap::getWikiIdFromDbDomain( WikiMap::getCurrentWikiDbDomain() ); + $data = []; try { /* Resolve site name */ if ( $this->interwikiScopes >= 3 && !$this->thisSite ) { - $site = $this->getCacheValue( '__sites:' . wfWikiID() ); + $site = $this->getCacheValue( '__sites:' . $wikiId ); if ( $site == '' ) { $this->thisSite = $this->fallbackSite; @@ -357,7 +364,7 @@ class ClassicInterwikiLookup implements InterwikiLookup { if ( $this->interwikiScopes >= 3 ) { $sources[] = '_' . $this->thisSite; } - $sources[] = wfWikiID(); + $sources[] = $wikiId; foreach ( $sources as $source ) { $list = $this->getCacheValue( '__list:' . $source );