Automattic\Jetpack\Device_Detection

User_Agent_Info::is_PalmWebOS()public staticWPSCache 1.0

Detects if the current browser is on a Palm device running the new WebOS. This EXCLUDES TouchPad.

Ex1: Mozilla/5.0 (webOS/1.4.0; U; en-US) AppleWebKit/532.2 (KHTML, like Gecko) Version/1.0 Safari/532.2 Pre/1.1 Ex2: Mozilla/5.0 (webOS/1.4.0; U; en-US) AppleWebKit/532.2 (KHTML, like Gecko) Version/1.0 Safari/532.2 Pixi/1.1

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

Хуков нет.

Возвращает

null. Ничего.

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

$result = User_Agent_Info::is_PalmWebOS();

Код User_Agent_Info::is_PalmWebOS() WPSCache 1.9.1

public static function is_PalmWebOS() {
	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 ( false === strpos( $ua, 'webos' ) ) {
		return false;
	} else {
		if ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() ) {
			return false;
		} else {
			return true;
		}
	}
}