Index: trunk/extensions/MobileFrontend/MobileFrontend.php |
— | — | @@ -84,7 +84,7 @@ |
85 | 85 | } |
86 | 86 | |
87 | 87 | class ExtMobileFrontend { |
88 | | - const VERSION = '0.5.68'; |
| 88 | + const VERSION = '0.5.69'; |
89 | 89 | |
90 | 90 | /** |
91 | 91 | * @var DOMDocument |
— | — | @@ -200,9 +200,8 @@ |
201 | 201 | ); |
202 | 202 | |
203 | 203 | public function testCanonicalRedirect( $request, $title, $output ) { |
204 | | - global $wgMobileDomain; |
205 | | - $host = $request->getHeader( 'HOST' ); |
206 | | - return !( stristr( $host, $wgMobileDomain ) !== false ); |
| 204 | + $xDevice = isset( $_SERVER['HTTP_X_DEVICE'] ) ? $_SERVER['HTTP_X_DEVICE'] : ''; |
| 205 | + return ( !empty( $xDevice ) ); |
207 | 206 | } |
208 | 207 | |
209 | 208 | public function addMobileFooter( &$obj, &$tpl ) { |
— | — | @@ -216,7 +215,7 @@ |
217 | 216 | $footerlinks = $tpl->data['footerlinks']; |
218 | 217 | $mobileViewUrl = $wgRequest->escapeAppendQuery( 'useformat=mobile' ); |
219 | 218 | |
220 | | - $tpl->set('mobileview', "<a href='{$mobileViewUrl}'>".wfMsg( 'mobile-frontend-view')."</a>"); |
| 219 | + $tpl->set('mobileview', "<a href='{$mobileViewUrl}'>" . wfMsg( 'mobile-frontend-view' ) . "</a>"); |
221 | 220 | $footerlinks['places'][] = 'mobileview'; |
222 | 221 | $tpl->set('footerlinks', $footerlinks); |
223 | 222 | } |