From 2a1b2ef334b693d925846547383389262bfdbb3b Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 20 May 2015 15:39:52 -0700 Subject: [PATCH] Made MessageCache::replace() ignore messages with content language suffix * This should not be used, and load() does not see them. If the content language is 'de', then message overrides will not include MediaWiki:/de pages. Change-Id: Ie4b6b356bd309814dd4a88040a29a7ebd509712a --- includes/cache/MessageCache.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php index 86b073c75e..99b969fa53 100644 --- a/includes/cache/MessageCache.php +++ b/includes/cache/MessageCache.php @@ -517,13 +517,17 @@ class MessageCache { * @param mixed $text New contents of the page. */ public function replace( $title, $text ) { - global $wgMaxMsgCacheEntrySize, $wgContLang; + global $wgMaxMsgCacheEntrySize, $wgContLang, $wgLanguageCode; if ( $this->mDisable ) { return; } list( $msg, $code ) = $this->figureMessage( $title ); + if ( strpos( $title, '/' ) !== false && $code === $wgLanguageCode ) { + # Content language overrides do not use the / suffix + return; + } $cacheKey = wfMemcKey( 'messages', $code ); $this->lock( $cacheKey ); @@ -567,7 +571,6 @@ class MessageCache { $blobStore->updateMessage( $wgContLang->lcfirst( $msg ) ); Hooks::run( 'MessageCacheReplace', array( $title, $text ) ); - } /** @@ -1088,6 +1091,7 @@ class MessageCache { */ public function figureMessage( $key ) { global $wgLanguageCode; + $pieces = explode( '/', $key ); if ( count( $pieces ) < 2 ) { return array( $key, $wgLanguageCode ); -- 2.20.1