Changed wfMessage() usage to call directly MessageCache::get() so that its $isFullKey...
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Fri, 30 Mar 2012 16:00:21 +0000 (18:00 +0200)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Fri, 30 Mar 2012 16:00:21 +0000 (18:00 +0200)
The $isFullKey parameter means the message key already contains the language subpage ("/de", etc.)

Change-Id: Iceb1243ae6af126e2abbabbb05441a8602c17ef6

includes/actions/RawAction.php

index e4c6b3e..5615ad5 100644 (file)
@@ -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() );