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
@@ 971-986 (lines=16) @@
968
	 * Nokia Browser for Series 40 is a proxy based browser, previously known as Ovi Browser.
969
	 * This browser will report 'NokiaBrowser' in the header, however some older version will also report 'OviBrowser'.
970
	 */
971
	public static function is_symbian_s40_platform() {
972
973
		if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
974
			return false;
975
		}
976
977
		$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
978
979
		if ( strpos( $agent, 'series40' ) !== false ) {
980
			if ( strpos( $agent, 'nokia' ) !== false || strpos( $agent, 'ovibrowser' ) !== false || strpos( $agent, 'nokiabrowser' ) !== false ) {
981
				return true;
982
			}
983
		}
984
985
		return false;
986
	}
987
988
	/**
989
	 * Returns if the device belongs to J2ME capable family.