Automattic\Jetpack\Device_Detection

User_Agent_Info::is_safari_browser()public staticWPSCache 1.0

Detect Safari browser

Method of the class: User_Agent_Info{}

No Hooks.

Return

null. Nothing (null).

Usage

$result = User_Agent_Info::is_safari_browser();

User_Agent_Info::is_safari_browser() code WPSCache 1.12.4

public static function is_safari_browser() {
	if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
		return false;
	}
	if ( false === strpos( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ), 'Safari' ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating.
		return false;
	}
	return true;
}