From d1abcf7e9205931d49b5ff6593407711d62eb750 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Fri, 30 Mar 2012 18:00:21 +0200 Subject: [PATCH] Changed wfMessage() usage to call directly MessageCache::get() so that its $isFullKey parameter can be set to true. The $isFullKey parameter means the message key already contains the language subpage ("/de", etc.) Change-Id: Iceb1243ae6af126e2abbabbb05441a8602c17ef6 --- includes/actions/RawAction.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/includes/actions/RawAction.php b/includes/actions/RawAction.php index e4c6b3e067..5615ad5221 100644 --- a/includes/actions/RawAction.php +++ b/includes/actions/RawAction.php @@ -120,10 +120,13 @@ class RawAction extends FormlessAction { // If it's a MediaWiki message we can just hit the message cache if ( $request->getBool( 'usemsgcache' ) && $title->getNamespace() == NS_MEDIAWIKI ) { - $key = $title->getDBkey(); - $msg = wfMessage( $key )->inContentLanguage(); - # If the message doesn't exist, return a blank - $text = !$msg->exists() ? '' : $msg->plain(); + // The first "true" is to use the database, the second is to use the content langue + // and the last one is to specify the message key already contains the language in it ("/de", etc.) + $text = MessageCache::singleton()->get( $title->getDBkey(), true, true, true ); + // If the message doesn't exist, return a blank + if ( $text === false ) { + $text = ''; + } } else { // Get it from the DB $rev = Revision::newFromTitle( $title, $this->getOldId() ); -- 2.20.1