r102407 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102406‎ | r102407 | r102408 >
Date:16:06, 8 November 2011
Author:ialex
Status:ok
Tags:
Comment:
Use the local context instead of $wgOut, now that we have one
Modified paths:
  • /trunk/phase3/includes/api/ApiMain.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiMain.php
@@ -404,7 +404,7 @@
405405 }
406406
407407 protected function sendCacheHeaders() {
408 - global $wgUseXVO, $wgOut, $wgVaryOnXFP;
 408+ global $wgUseXVO, $wgVaryOnXFP;
409409 $response = $this->getRequest()->response();
410410
411411 if ( $this->mCacheMode == 'private' ) {
@@ -416,11 +416,12 @@
417417 $xfp = $wgVaryOnXFP ? ', X-Forwarded-Proto' : '';
418418 $response->header( 'Vary: Accept-Encoding, Cookie' . $xfp );
419419 if ( $wgUseXVO ) {
 420+ $out = $this->getOutput();
420421 if ( $wgVaryOnXFP ) {
421 - $wgOut->addVaryHeader( 'X-Forwarded-Proto' );
 422+ $out->addVaryHeader( 'X-Forwarded-Proto' );
422423 }
423 - $response->header( $wgOut->getXVO() );
424 - if ( $wgOut->haveCacheVaryCookies() ) {
 424+ $response->header( $out->getXVO() );
 425+ if ( $out->haveCacheVaryCookies() ) {
425426 // Logged in, mark this request private
426427 $response->header( 'Cache-Control: private' );
427428 return;

Status & tagging log