Index: branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.php |
— | — | @@ -49,7 +49,7 @@ |
50 | 50 | $wgHooks['SkinTemplateOutputPageBeforeExec'][] = array( &$wgExtMobileFrontend, 'addMobileFooter' ); |
51 | 51 | |
52 | 52 | class ExtMobileFrontend { |
53 | | - const VERSION = '0.5.25'; |
| 53 | + const VERSION = '0.5.26'; |
54 | 54 | |
55 | 55 | /** |
56 | 56 | * @var DOMDocument |
— | — | @@ -341,6 +341,7 @@ |
342 | 342 | $mAction !== 'view_normal_site' ) { |
343 | 343 | $this->getMsg(); |
344 | 344 | $this->disableCaching(); |
| 345 | + $this->sendXDeviceVaryHeader(); |
345 | 346 | ob_start( array( $this, 'DOMParse' ) ); |
346 | 347 | } |
347 | 348 | } |
— | — | @@ -376,6 +377,15 @@ |
377 | 378 | header( 'Pragma: no-cache' ); |
378 | 379 | } |
379 | 380 | } |
| 381 | + |
| 382 | + private function sendXDeviceVaryHeader() { |
| 383 | + global $wgOut; |
| 384 | + |
| 385 | + if ( !empty( $_SERVER['HTTP_X_DEVICE'] ) ) { |
| 386 | + header( 'X-Device: ' . $_SERVER['HTTP_X_DEVICE'] ); |
| 387 | + $wgOut->addVaryHeader( 'X-Device' ); |
| 388 | + } |
| 389 | + } |
380 | 390 | |
381 | 391 | private function renderOptInMobileSiteXHTML() { |
382 | 392 | if ( $this->contentFormat == 'XHTML' ) { |