Merge branch 'master' into Wikidata
[lhc/web/wiklou.git] / includes / actions / RawAction.php
index 1cac44c..f07b5b6 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() );
@@ -175,7 +178,7 @@ class RawAction extends FormlessAction {
                                # output previous revision, or nothing if there isn't one
                                if( !$oldid ) {
                                        # get the current revision so we can get the penultimate one
-                                       $oldid = $this->getTitle()->getLatestRevID();
+                                       $oldid = $this->page->getLatest();
                                }
                                $prev = $this->getTitle()->getPreviousRevisionId( $oldid );
                                $oldid = $prev ? $prev : -1 ;