interwiki: Remove inappropiate use of wfMemcKey()
authorTimo Tijhof <krinklemail@gmail.com>
Tue, 11 Apr 2017 02:34:38 +0000 (19:34 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Tue, 11 Apr 2017 22:39:41 +0000 (22:39 +0000)
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

index 883b5fa..f19e3db 100644 (file)
@@ -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}" );