From 6375900e966122a6e8e6c0024934a65e76110097 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Mon, 10 Apr 2017 19:34:38 -0700 Subject: [PATCH] interwiki: Remove inappropiate use of wfMemcKey() This is used for lookup in a CDB file or PHP static array. In neither case is the key created by wfMemcKey() or any other implementation of BagOStuff::makeKey(). This is already broken if: * An interwiki prefix were to contain characters not supported by Memcached. * An interwiki prefix and wikiid together are too long for Memcached. * If the site has wgCachePrefix configured, which overrides the wfWikiID() namespace makeKey() normally uses. dumpInterwiki.php does not use wfMemcKey() either (and should not). This was simply here as leftover from many rewrites ago, its only purpose is to create wikiid + prefix joined by colon. Ref T148958. Change-Id: I45682133ed593fbb0d66af5a67751f77f15a4a14 --- includes/interwiki/ClassicInterwikiLookup.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/interwiki/ClassicInterwikiLookup.php b/includes/interwiki/ClassicInterwikiLookup.php index 883b5fac46..f19e3dbcfb 100644 --- a/includes/interwiki/ClassicInterwikiLookup.php +++ b/includes/interwiki/ClassicInterwikiLookup.php @@ -221,7 +221,7 @@ class ClassicInterwikiLookup implements InterwikiLookup { } } - $value = $this->getCacheValue( wfMemcKey( $prefix ) ); + $value = $this->getCacheValue( wfWikiID() . ':' . $prefix ); // Site level if ( $value == '' && $this->interwikiScopes >= 3 ) { $value = $this->getCacheValue( "_{$this->thisSite}:{$prefix}" ); -- 2.20.1