Code Duplication    Length = 13-15 lines in 3 locations

class.jetpack-user-agent.php 3 locations

@@ 576-588 (lines=13) @@
573
	 * 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
574
	 *
575
	 */
576
	static function is_twitter_for_ipad( ) {
577
		if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
578
			return false;
579
580
		$ua = strtolower( $_SERVER['HTTP_USER_AGENT'] );
581
582
		if ( strpos( $ua, 'twitter for ipad' ) !== false )
583
			return true;
584
		elseif( strpos( $ua, 'ipad' ) !== false && strpos( $ua, 'twitter for iphone' ) !== false )
585
			return true;
586
		else
587
			return false;
588
	}
589
590
591
	/*
@@ 706-719 (lines=14) @@
703
	 * The platform section will include 'Mobile' for phones and 'Tablet' for tablets.
704
	 *
705
	 */
706
	static function is_firefox_desktop() {
707
708
		if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
709
			return false;
710
		}
711
712
		$ua = strtolower( $_SERVER['HTTP_USER_AGENT'] );
713
714
		if ( false !== strpos( $ua, 'firefox' ) && false === strpos( $ua, 'mobile' ) && false === strpos( $ua, 'tablet' ) ) {
715
			return true;
716
		} else {
717
			return false;
718
		}
719
	}
720
721
	/*
722
	 * Detects if the current browser is FirefoxOS Native browser
@@ 1011-1025 (lines=15) @@
1008
	    return false;
1009
	}
1010
1011
	static function is_J2ME_platform() {
1012
1013
		if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
1014
			return false;
1015
1016
		$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
1017
1018
		if ( strpos( $agent, 'j2me/midp' ) !== false ) {
1019
			return true;
1020
		} elseif ( strpos( $agent, 'midp' ) !== false && strpos( $agent, 'cldc' ) ) {
1021
			return true;
1022
		}
1023
1024
	    return false;
1025
	}
1026
1027
1028
	/*