Code Duplication    Length = 13-15 lines in 3 locations

class.jetpack-user-agent.php 3 locations

@@ 595-607 (lines=13) @@
592
	 * Ver 5.0 or Higher - Mozilla/5.0 (iPad; CPU OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B206 Twitter for iPhone
593
	 *
594
	 */
595
	static function is_twitter_for_ipad() {
596
		if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
597
			return false;
598
		}
599
600
		$ua = strtolower( $_SERVER['HTTP_USER_AGENT'] );
601
602
		if ( strpos( $ua, 'twitter for ipad' ) !== false ) {
603
			return true;
604
		} elseif ( strpos( $ua, 'ipad' ) !== false && strpos( $ua, 'twitter for iphone' ) !== false ) {
605
			return true;
606
		} else {
607
			return false;
608
		}
609
	}
610
@@ 739-752 (lines=14) @@
736
	 * The platform section will include 'Mobile' for phones and 'Tablet' for tablets.
737
	 *
738
	 */
739
	static function is_firefox_desktop() {
740
741
		if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
742
			return false;
743
		}
744
745
		$ua = strtolower( $_SERVER['HTTP_USER_AGENT'] );
746
747
		if ( false !== strpos( $ua, 'firefox' ) && false === strpos( $ua, 'mobile' ) && false === strpos( $ua, 'tablet' ) ) {
748
			return true;
749
		} else {
750
			return false;
751
		}
752
	}
753
754
	/*
755
	 * Detects if the current browser is FirefoxOS Native browser
@@ 1069-1083 (lines=15) @@
1066
		return false;
1067
	}
1068
1069
	static function is_J2ME_platform() {
1070
1071
		if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
1072
			return false;
1073
		}
1074
1075
		$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
1076
1077
		if ( strpos( $agent, 'j2me/midp' ) !== false ) {
1078
			return true;
1079
		} elseif ( strpos( $agent, 'midp' ) !== false && strpos( $agent, 'cldc' ) ) {
1080
			return true;
1081
		}
1082
1083
		return false;
1084
	}
1085
1086