X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Factions%2FRawAction.php;h=d8c8bc3213eee560d4136e11d1e4429bc347d05c;hb=207d1cfb7c32c0a903edb3db7a899c643726e86f;hp=b371848e7bd634b746832caeca84837c8427f68e;hpb=2257fe42288cca06376e5caf45aa32da9d0216cf;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/actions/RawAction.php b/includes/actions/RawAction.php index b371848e7b..d8c8bc3213 100644 --- a/includes/actions/RawAction.php +++ b/includes/actions/RawAction.php @@ -80,6 +80,12 @@ class RawAction extends FormlessAction { } } + // Set standard Vary headers so cache varies on cookies and such (T125283) + $response->header( $this->getOutput()->getVaryHeader() ); + if ( $config->get( 'UseKeyHeader' ) ) { + $response->header( $this->getOutput()->getKeyHeader() ); + } + $response->header( 'Content-type: ' . $contentType . '; charset=UTF-8' ); // Output may contain user-specific data; // vary generated content for open sessions on private wikis @@ -102,7 +108,9 @@ class RawAction extends FormlessAction { $response->statusHeader( 404 ); } - if ( !Hooks::run( 'RawPageViewBeforeOutput', array( &$this, &$text ) ) ) { + // Avoid PHP 7.1 warning of passing $this by reference + $rawAction = $this; + if ( !Hooks::run( 'RawPageViewBeforeOutput', [ &$rawAction, &$text ] ) ) { wfDebug( __METHOD__ . ": RawPageViewBeforeOutput hook broke raw page output.\n" ); } @@ -228,7 +236,7 @@ class RawAction extends FormlessAction { } } - $allowedCTypes = array( 'text/x-wiki', 'text/javascript', 'text/css', 'application/x-zope-edit' ); + $allowedCTypes = [ 'text/x-wiki', 'text/javascript', 'text/css', 'application/x-zope-edit' ]; if ( $ctype == '' || !in_array( $ctype, $allowedCTypes ) ) { $ctype = 'text/x-wiki'; }