Reverted r101014 per CR. Added comment. The sooner RL2 kills this the better...
authorAaron Schulz <aaron@users.mediawiki.org>
Tue, 20 Dec 2011 00:57:25 +0000 (00:57 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Tue, 20 Dec 2011 00:57:25 +0000 (00:57 +0000)
includes/actions/RawAction.php

index 5f617d7..019d538 100644 (file)
@@ -74,8 +74,7 @@ class RawAction extends FormlessAction {
                $response->header( 'Content-type: ' . $contentType . '; charset=UTF-8' );
                # Output may contain user-specific data;
                # vary generated content for open sessions on private wikis
-               $privateCache = !$wgGroupPermissions['*']['read']
-                       && ( $smaxage == 0 || session_id() != '' );
+               $privateCache = !$wgGroupPermissions['*']['read'] && ( $smaxage == 0 || session_id() != '' );
                # allow the client to cache this for 24 hours
                $mode = $privateCache ? 'private' : 'public';
                $response->header( 'Cache-Control: ' . $mode . ', s-maxage=' . $smaxage . ', max-age=' . $maxage );
@@ -117,7 +116,8 @@ 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 ) {
-                       $msg = wfMessage( $title->getDBkey() )->inContentLanguage();
+                       $key = $title->getDBkey();
+                       $msg = wfMessage( $key )->inContentLanguage();
                        # If the message doesn't exist, return a blank
                        $text = !$msg->exists() ? '' : $msg->plain();
                } else {
@@ -127,7 +127,8 @@ class RawAction extends FormlessAction {
                                $lastmod = wfTimestamp( TS_RFC2822, $rev->getTimestamp() );
                                $request->response()->header( "Last-modified: $lastmod" );
 
-                               $text = $rev->getText( Revision::FOR_THIS_USER, $this->getUser() );
+                               // Public-only due to cache headers
+                               $text = $rev->getText();
                                $section = $request->getIntOrNull( 'section' );
                                if ( $section !== null ) {
                                        $text = $wgParser->getSection( $text, $section );