From e6f780d48d949ec67d47667b853326623827974d Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 20 Dec 2011 00:57:25 +0000 Subject: [PATCH] Reverted r101014 per CR. Added comment. The sooner RL2 kills this the better... --- includes/actions/RawAction.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/includes/actions/RawAction.php b/includes/actions/RawAction.php index 5f617d753f..019d53839a 100644 --- a/includes/actions/RawAction.php +++ b/includes/actions/RawAction.php @@ -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 ); -- 2.20.1