Index: trunk/extensions/MobileFrontend/MobileFrontend.php |
— | — | @@ -65,7 +65,7 @@ |
66 | 66 | ); |
67 | 67 | |
68 | 68 | class ExtMobileFrontend { |
69 | | - const VERSION = '0.5.41'; |
| 69 | + const VERSION = '0.5.42'; |
70 | 70 | |
71 | 71 | /** |
72 | 72 | * @var DOMDocument |
— | — | @@ -378,19 +378,20 @@ |
379 | 379 | } |
380 | 380 | |
381 | 381 | private function disableCaching() { |
| 382 | + global $wgRequest; |
382 | 383 | if ( isset( $_SERVER['HTTP_VIA'] ) && |
383 | 384 | 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' ); |
387 | 388 | } |
388 | 389 | } |
389 | 390 | |
390 | 391 | private function sendXDeviceVaryHeader() { |
391 | | - global $wgOut; |
| 392 | + global $wgOut, $wgRequest; |
392 | 393 | |
393 | 394 | if ( !empty( $_SERVER['HTTP_X_DEVICE'] ) ) { |
394 | | - header( 'X-Device: ' . $_SERVER['HTTP_X_DEVICE'] ); |
| 395 | + $wgRequest->response()->header( 'X-Device: ' . $_SERVER['HTTP_X_DEVICE'] ); |
395 | 396 | $wgOut->addVaryHeader( 'X-Device' ); |
396 | 397 | } |
397 | 398 | } |