Automattic\Jetpack\Device_Detection

User_Agent_Info::is_firefox_mobile()public staticWPSCache 1.0

Detects if the current browser is Firefox Mobile (Fennec)

See http://www.useragentstring.com/pages/Fennec/ Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.1.1) Gecko/20110415 Firefox/4.0.2pre Fennec/4.0.1 Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b2pre) Gecko/20081015 Fennec/1.0a1

Метод класса: User_Agent_Info{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$result = User_Agent_Info::is_firefox_mobile();

Код User_Agent_Info::is_firefox_mobile() WPSCache 1.12.0

public static function is_firefox_mobile() {

	if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
		return false;
	}

	$ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating.

	if ( strpos( $ua, 'fennec' ) !== false ) {
		return true;
	} else {
		return false;
	}
}