Code Duplication    Length = 16-17 lines in 2 locations

projects/packages/device-detection/src/class-user-agent-info.php 2 locations

@@ 581-597 (lines=17) @@
578
	 * - Mozilla/5.0 (iPad; U; CPU iPhone OS 5_0 like Mac OS X; en_US) AppleWebKit (KHTML, like Gecko) Mobile [FBAN/FBForIPhone;FBAV/4.0.2;FBBV/4020.0;FBDV/iPad2,1;FBMD/iPad;FBSN/iPhone OS;FBSV/5.0;FBSS/1; FBCR/;FBID/tablet;FBLC/en_US;FBSF/1.0]
579
	 * - Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Mobile/10A403 [FBAN/FBIOS;FBAV/5.0;FBBV/47423;FBDV/iPad2,1;FBMD/iPad;FBSN/iPhone OS;FBSV/6.0;FBSS/1; FBCR/;FBID/tablet;FBLC/en_US]
580
	 */
581
	public static function is_facebook_for_ipad() {
582
		if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
583
			return false;
584
		}
585
586
		$ua = strtolower( $_SERVER['HTTP_USER_AGENT'] );
587
588
		if ( false === strpos( $ua, 'ipad' ) ) {
589
			return false;
590
		}
591
592
		if ( false !== strpos( $ua, 'facebook' ) || false !== strpos( $ua, 'fbforiphone' ) || false !== strpos( $ua, 'fban/fbios;' ) ) {
593
			return true;
594
		} else {
595
			return false;
596
		}
597
	}
598
599
	/**
600
	 *  Detects if the current UA is WordPress for iOS
@@ 990-1005 (lines=16) @@
987
	 * Nokia Browser for Series 40 is a proxy based browser, previously known as Ovi Browser.
988
	 * This browser will report 'NokiaBrowser' in the header, however some older version will also report 'OviBrowser'.
989
	 */
990
	public static function is_symbian_s40_platform() {
991
992
		if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
993
			return false;
994
		}
995
996
		$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
997
998
		if ( strpos( $agent, 'series40' ) !== false ) {
999
			if ( strpos( $agent, 'nokia' ) !== false || strpos( $agent, 'ovibrowser' ) !== false || strpos( $agent, 'nokiabrowser' ) !== false ) {
1000
				return true;
1001
			}
1002
		}
1003
1004
		return false;
1005
	}
1006
1007
	/**
1008
	 * Returns if the device belongs to J2ME capable family.