@@ 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 | * Detects if the current browser is Opera Mobile |
|
@@ 721-735 (lines=15) @@ | ||
718 | * Opera/9.80 (Windows NT 6.1; Opera Mobi/14316; U; en) Presto/2.7.81 Version/11.00" |
|
719 | * Opera/9.50 (Nintendo DSi; Opera/507; U; en-US) |
|
720 | */ |
|
721 | public static function is_opera_mobile() { |
|
722 | if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { |
|
723 | return false; |
|
724 | } |
|
725 | ||
726 | $ua = strtolower( $_SERVER['HTTP_USER_AGENT'] ); |
|
727 | ||
728 | if ( strpos( $ua, 'opera' ) !== false && strpos( $ua, 'mobi' ) !== false ) { |
|
729 | return true; |
|
730 | } elseif ( strpos( $ua, 'opera' ) !== false && strpos( $ua, 'nintendo dsi' ) !== false ) { |
|
731 | return true; |
|
732 | } else { |
|
733 | return false; |
|
734 | } |
|
735 | } |
|
736 | ||
737 | /** |
|
738 | * Detects if the current browser is Opera Mini |