Merge "Made MessageCache::replace() ignore messages with content language suffix"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 11 Jun 2015 15:53:27 +0000 (15:53 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 11 Jun 2015 15:53:27 +0000 (15:53 +0000)
includes/cache/MessageCache.php

index 86b073c..99b969f 100644 (file)
@@ -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 /<code> 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 );