Code Duplication    Length = 10-14 lines in 4 locations

class.jetpack-user-agent.php 4 locations

@@ 1141-1154 (lines=14) @@
1138
	/*
1139
	 is_webkit() can be used to check the User Agent for an webkit generic browser
1140
	 */
1141
	static function is_webkit() {
1142
1143
		if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
1144
			return false;
1145
		}
1146
1147
		$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
1148
1149
		$pos_webkit = strpos( $agent, 'webkit' );
1150
1151
		if ( $pos_webkit !== false ) {
1152
			return true;
1153
		} else {
1154
			return false;
1155
		}
1156
	}
1157
@@ 1241-1250 (lines=10) @@
1238
	 *
1239
	 * @return boolean true if the browser is Kindle monochrome Native browser otherwise false
1240
	 */
1241
	static function is_kindle_touch() {
1242
		if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
1243
			return false;
1244
		}
1245
		$agent            = strtolower( $_SERVER['HTTP_USER_AGENT'] );
1246
		$pos_kindle_touch = strpos( $agent, 'kindle/3.0+' );
1247
		if ( false !== $pos_kindle_touch && false === self::is_kindle_fire() ) {
1248
			return true;
1249
		} else {
1250
			return false;
1251
		}
1252
	}
1253
@@ 1256-1266 (lines=11) @@
1253
1254
1255
	// Detect if user agent is the WordPress.com Windows 8 app (used ONLY on the custom oauth stylesheet)
1256
	static function is_windows8_auth() {
1257
		if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
1258
			return false;
1259
		}
1260
1261
		$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
1262
		$pos   = strpos( $agent, 'msauthhost' );
1263
		if ( false !== $pos ) {
1264
			return true;
1265
		} else {
1266
			return false;
1267
		}
1268
	}
1269
@@ 1271-1281 (lines=11) @@
1268
	}
1269
1270
	// Detect if user agent is the WordPress.com Windows 8 app.
1271
	static function is_wordpress_for_win8() {
1272
		if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
1273
			return false;
1274
		}
1275
1276
		$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
1277
		$pos   = strpos( $agent, 'wp-windows8' );
1278
		if ( false !== $pos ) {
1279
			return true;
1280
		} else {
1281
			return false;
1282
		}
1283
	}
1284