From: Aaron Schulz Date: Sat, 23 Jun 2018 16:59:12 +0000 (+0100) Subject: Make MessageCache::getMsgFromNamespace() process cache hook-defined keys X-Git-Tag: 1.34.0-rc.0~4987^2 X-Git-Url: http://git.cyclocoop.org/data/Fool?a=commitdiff_plain;h=5c0937b167d176b4af29b5bbe2a4c5073e821c2c;p=lhc%2Fweb%2Fwiklou.git Make MessageCache::getMsgFromNamespace() process cache hook-defined keys Change-Id: I6f8a0c002b54dc48bc3e6902ab1ba41b2f99412a --- diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php index b6213c1d32..0854a43e95 100644 --- a/includes/cache/MessageCache.php +++ b/includes/cache/MessageCache.php @@ -32,7 +32,8 @@ use Wikimedia\Rdbms\Database; define( 'MSG_CACHE_VERSION', 2 ); /** - * Message cache + * Cache of messages that are defined by MediaWiki namespace pages or by hooks + * * Performs various MediaWiki namespace-related functions * @ingroup Cache */ @@ -980,14 +981,15 @@ class MessageCache { } // Fall through and try invididual message cache below } else { - // XXX: This is not cached in process cache, should it? $message = false; Hooks::run( 'MessagesPreLoad', [ $title, &$message, $code ] ); if ( $message !== false ) { - return $message; + $this->mCache[$code][$title] = ' ' . $message; + } else { + $this->mCache[$code][$title] = '!NONEXISTENT'; } - return false; + return $message; } // Individual message cache key