Index: trunk/extensions/MobileFrontend/DeviceDetection.php |
— | — | @@ -294,6 +294,9 @@ |
295 | 295 | |
296 | 296 | if ( preg_match( '/Android/', $userAgent ) ) { |
297 | 297 | $formatName = 'android'; |
| 298 | + if ( strpos( $userAgent, 'Opera Mini' ) !== false ) { |
| 299 | + $formatName = 'operamini'; |
| 300 | + } |
298 | 301 | } elseif ( preg_match( '/iPhone.* Safari/', $userAgent ) ) { |
299 | 302 | if ( strpos( $userAgent, 'iPhone OS 2' ) !== false ) { |
300 | 303 | $formatName = 'iphone2'; |
Index: trunk/extensions/MobileFrontend/MobileFrontend.php |
— | — | @@ -65,7 +65,7 @@ |
66 | 66 | ); |
67 | 67 | |
68 | 68 | class ExtMobileFrontend { |
69 | | - const VERSION = '0.5.49'; |
| 69 | + const VERSION = '0.5.50'; |
70 | 70 | |
71 | 71 | /** |
72 | 72 | * @var DOMDocument |
— | — | @@ -292,10 +292,18 @@ |
293 | 293 | self::$search = $wgRequest->getText( 'search' ); |
294 | 294 | self::$callback = $wgRequest->getText( 'callback' ); |
295 | 295 | self::$searchField = $wgRequest->getText( 'search', '' ); |
| 296 | + |
| 297 | + $xDevice = isset( $_SERVER['HTTP_X_DEVICE'] ) ? $_SERVER['HTTP_X_DEVICE'] : ''; |
296 | 298 | |
297 | 299 | $acceptHeader = $_SERVER["HTTP_ACCEPT"]; |
298 | 300 | $device = new DeviceDetection(); |
299 | | - $formatName = $device->formatName( $userAgent, $acceptHeader ); |
| 301 | + |
| 302 | + if ( !empty( $xDevice ) ) { |
| 303 | + $formatName = $xDevice; |
| 304 | + } else { |
| 305 | + $formatName = $device->formatName( $userAgent, $acceptHeader ); |
| 306 | + } |
| 307 | + |
300 | 308 | self::$device = $device->format( $formatName ); |
301 | 309 | |
302 | 310 | if ( self::$device['view_format'] === 'wml' ) { |
— | — | @@ -366,8 +374,6 @@ |
367 | 375 | |
368 | 376 | // Determine |
369 | 377 | |
370 | | - $xDevice = isset( $_SERVER['HTTP_X_DEVICE'] ) ? $_SERVER['HTTP_X_DEVICE'] : ''; |
371 | | - |
372 | 378 | if (self::$useFormat === 'mobile' || |
373 | 379 | self::$useFormat === 'mobile-wap' || |
374 | 380 | !empty( $xDevice ) ) { |
— | — | @@ -529,7 +535,7 @@ |
530 | 536 | Html::rawElement( 'a', |
531 | 537 | array( 'href' => '#section_' . intval( $headings - 1 ), |
532 | 538 | 'class' => 'back_to_top' ), |
533 | | - '↑' . $backToTop ) . |
| 539 | + '↑' . $backToTop ) . |
534 | 540 | Html::closeElement( 'div' ); |
535 | 541 | // generate the HTML we are going to inject |
536 | 542 | $buttons = Html::element( 'button', |