r95046 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95045‎ | r95046 | r95047 >
Date:22:24, 19 August 2011
Author:preilly
Status:ok
Tags:
Comment:
fix use of header function directly use WebResponse::header() instead
Modified paths:
  • /trunk/extensions/MobileFrontend/MobileFrontend.php (modified) (history)

Diff [purge]

Index: trunk/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 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r95047mft r95046preilly22:26, 19 August 2011

Status & tagging log