r95047 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95046‎ | r95047 | r95048 >
Date:22:26, 19 August 2011
Author:preilly
Status:ok
Tags:
Comment:
mft r95046
Modified paths:
  • /branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.php
@@ -65,7 +65,7 @@
6666 );
6767
6868 class ExtMobileFrontend {
69 - const VERSION = '0.5.41';
 69+ const VERSION = '0.5.42';
7070
7171 /**
7272 * @var DOMDocument
@@ -378,19 +378,20 @@
379379 }
380380
381381 private function disableCaching() {
 382+ global $wgRequest;
382383 if ( isset( $_SERVER['HTTP_VIA'] ) &&
383384 stripos( $_SERVER['HTTP_VIA'], '.wikimedia.org:3128' ) !== false ) {
384 - header( 'Cache-Control: no-cache, must-revalidate' );
385 - header( 'Expires: Sat, 26 Jul 1997 05:00:00 GMT' );
386 - header( 'Pragma: no-cache' );
 385+ $wgRequest->response()->header( 'Cache-Control: no-cache, must-revalidate' );
 386+ $wgRequest->response()->header( 'Expires: Sat, 26 Jul 1997 05:00:00 GMT' );
 387+ $wgRequest->response()->header( 'Pragma: no-cache' );
387388 }
388389 }
389390
390391 private function sendXDeviceVaryHeader() {
391 - global $wgOut;
 392+ global $wgOut, $wgRequest;
392393
393394 if ( !empty( $_SERVER['HTTP_X_DEVICE'] ) ) {
394 - header( 'X-Device: ' . $_SERVER['HTTP_X_DEVICE'] );
 395+ $wgRequest->response()->header( 'X-Device: ' . $_SERVER['HTTP_X_DEVICE'] );
395396 $wgOut->addVaryHeader( 'X-Device' );
396397 }
397398 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r95046fix use of header function directly use WebResponse::header() insteadpreilly22:24, 19 August 2011

Status & tagging log