From: Aaron Schulz Date: Wed, 20 May 2015 22:39:52 +0000 (-0700) Subject: Made MessageCache::replace() ignore messages with content language suffix X-Git-Tag: 1.31.0-rc.0~11114^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=2a1b2ef334b693d925846547383389262bfdbb3b;p=lhc%2Fweb%2Fwiklou.git 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 --- 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 );