@@ 1048-1061 (lines=14) @@ | ||
1045 | /* |
|
1046 | is_webkit() can be used to check the User Agent for an webkit generic browser |
|
1047 | */ |
|
1048 | static function is_webkit() { |
|
1049 | ||
1050 | if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) |
|
1051 | return false; |
|
1052 | ||
1053 | $agent = strtolower( $_SERVER['HTTP_USER_AGENT'] ); |
|
1054 | ||
1055 | $pos_webkit = strpos( $agent, 'webkit' ); |
|
1056 | ||
1057 | if ( $pos_webkit !== false ) |
|
1058 | return true; |
|
1059 | else |
|
1060 | return false; |
|
1061 | } |
|
1062 | ||
1063 | /** |
|
1064 | * Detects if the current browser is the Native Android browser. |
|
@@ 1138-1147 (lines=10) @@ | ||
1135 | * |
|
1136 | * @return boolean true if the browser is Kindle monochrome Native browser otherwise false |
|
1137 | */ |
|
1138 | static function is_kindle_touch( ) { |
|
1139 | if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) |
|
1140 | return false; |
|
1141 | $agent = strtolower( $_SERVER['HTTP_USER_AGENT'] ); |
|
1142 | $pos_kindle_touch = strpos( $agent, 'kindle/3.0+' ); |
|
1143 | if ( $pos_kindle_touch !== false && self::is_kindle_fire() === false ) |
|
1144 | return true; |
|
1145 | else |
|
1146 | return false; |
|
1147 | } |
|
1148 | ||
1149 | ||
1150 | // Detect if user agent is the WordPress.com Windows 8 app (used ONLY on the custom oauth stylesheet) |
|
@@ 1151-1161 (lines=11) @@ | ||
1148 | ||
1149 | ||
1150 | // Detect if user agent is the WordPress.com Windows 8 app (used ONLY on the custom oauth stylesheet) |
|
1151 | static function is_windows8_auth( ) { |
|
1152 | if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) |
|
1153 | return false; |
|
1154 | ||
1155 | $agent = strtolower( $_SERVER['HTTP_USER_AGENT'] ); |
|
1156 | $pos = strpos( $agent, 'msauthhost' ); |
|
1157 | if ( $pos !== false ) |
|
1158 | return true; |
|
1159 | else |
|
1160 | return false; |
|
1161 | } |
|
1162 | ||
1163 | // Detect if user agent is the WordPress.com Windows 8 app. |
|
1164 | static function is_wordpress_for_win8( ) { |
|
@@ 1164-1174 (lines=11) @@ | ||
1161 | } |
|
1162 | ||
1163 | // Detect if user agent is the WordPress.com Windows 8 app. |
|
1164 | static function is_wordpress_for_win8( ) { |
|
1165 | if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) |
|
1166 | return false; |
|
1167 | ||
1168 | $agent = strtolower( $_SERVER['HTTP_USER_AGENT'] ); |
|
1169 | $pos = strpos( $agent, 'wp-windows8' ); |
|
1170 | if ( $pos !== false ) |
|
1171 | return true; |
|
1172 | else |
|
1173 | return false; |
|
1174 | } |
|
1175 | ||
1176 | ||
1177 | /* |