|
@@ 694-707 (lines=14) @@
|
| 691 |
|
* |
| 692 |
|
* Mozilla/5.0 (Mobile; rv:14.0) Gecko/14.0 Firefox/14.0 |
| 693 |
|
*/ |
| 694 |
|
public static function is_firefox_os() { |
| 695 |
|
|
| 696 |
|
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { |
| 697 |
|
return false; |
| 698 |
|
} |
| 699 |
|
|
| 700 |
|
$ua = strtolower( $_SERVER['HTTP_USER_AGENT'] ); |
| 701 |
|
|
| 702 |
|
if ( strpos( $ua, 'mozilla' ) !== false && strpos( $ua, 'mobile' ) !== false && strpos( $ua, 'gecko' ) !== false && strpos( $ua, 'firefox' ) !== false ) { |
| 703 |
|
return true; |
| 704 |
|
} else { |
| 705 |
|
return false; |
| 706 |
|
} |
| 707 |
|
} |
| 708 |
|
|
| 709 |
|
/** |
| 710 |
|
* Detect modern Opera desktop |
|
@@ 740-754 (lines=15) @@
|
| 737 |
|
* Opera/9.80 (Windows NT 6.1; Opera Mobi/14316; U; en) Presto/2.7.81 Version/11.00" |
| 738 |
|
* Opera/9.50 (Nintendo DSi; Opera/507; U; en-US) |
| 739 |
|
*/ |
| 740 |
|
public static function is_opera_mobile() { |
| 741 |
|
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { |
| 742 |
|
return false; |
| 743 |
|
} |
| 744 |
|
|
| 745 |
|
$ua = strtolower( $_SERVER['HTTP_USER_AGENT'] ); |
| 746 |
|
|
| 747 |
|
if ( strpos( $ua, 'opera' ) !== false && strpos( $ua, 'mobi' ) !== false ) { |
| 748 |
|
return true; |
| 749 |
|
} elseif ( strpos( $ua, 'opera' ) !== false && strpos( $ua, 'nintendo dsi' ) !== false ) { |
| 750 |
|
return true; |
| 751 |
|
} else { |
| 752 |
|
return false; |
| 753 |
|
} |
| 754 |
|
} |
| 755 |
|
|
| 756 |
|
/** |
| 757 |
|
* Detects if the current browser is Opera Mini |