Automattic\Jetpack\Device_Detection

User_Agent_Info::is_blackbeberry()public staticWPSCache 1.0

The is_blackbeberry() method can be used to check the User Agent for a blackberry device. Note that opera mini on BB matches this rule.

Method of the class: User_Agent_Info{}

No Hooks.

Return

null. Nothing (null).

Usage

$result = User_Agent_Info::is_blackbeberry();

User_Agent_Info::is_blackbeberry() code WPSCache 1.12.0

public static function is_blackbeberry() {
	if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
		return false;
	}

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

	$pos_blackberry = strpos( $agent, 'blackberry' );
	if ( false !== $pos_blackberry ) {
		if ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() ) {
			return false;
		} else {
			return true;
		}
	} else {
		return false;
	}
}