Code Duplication    Length = 14-16 lines in 2 locations

packages/device-detection/src/class-device-detection.php 2 locations

@@ 762-775 (lines=14) @@
759
	 * The platform section will include 'Mobile' for phones and 'Tablet' for tablets.
760
	 *
761
	 */
762
	static function is_firefox_desktop() {
763
764
		if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
765
			return false;
766
		}
767
768
		$ua = strtolower( $_SERVER['HTTP_USER_AGENT'] );
769
770
		if ( false !== strpos( $ua, 'firefox' ) && false === strpos( $ua, 'mobile' ) && false === strpos( $ua, 'tablet' ) ) {
771
			return true;
772
		} else {
773
			return false;
774
		}
775
	}
776
777
	/*
778
	 * Detects if the current browser is FirefoxOS Native browser
@@ 1092-1107 (lines=16) @@
1089
		return false;
1090
	}
1091
1092
	static function is_J2ME_platform() {
1093
1094
		if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
1095
			return false;
1096
		}
1097
1098
		$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
1099
1100
		if ( strpos( $agent, 'j2me/midp' ) !== false ) {
1101
			return true;
1102
		} elseif ( strpos( $agent, 'midp' ) !== false && strpos( $agent, 'cldc' ) ) {
1103
			return true;
1104
		}
1105
1106
		return false;
1107
	}
1108
1109
1110
	/*