Automattic\WPSC\Device_Detection

User_Agent_Info::is_S60_OSSBrowserpublic staticWPSCache 1.0

Detects if the current browser is the Series 60 Open Source Browser.

OSS Browser 3.2 on E75: Mozilla/5.0 (SymbianOS/9.3; U; Series60/3.2 NokiaE75-1/110.48.125 Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413

7.0 Browser (Nokia 5800 XpressMusic (v21.0.025)) : Mozilla/5.0 (SymbianOS/9.4; U; Series60/5.0 Nokia5800d-1/21.0.025; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413

Browser 7.1 (Nokia N97 (v12.0.024)) : Mozilla/5.0 (SymbianOS/9.4; Series60/5.0 NokiaN97-1/12.0.024; Profile/MIDP-2.1 Configuration/CLDC-1.1; en-us) AppleWebKit/525 (KHTML, like Gecko) BrowserNG/7.1.12344

Method of the class: User_Agent_Info{}

No Hooks.

Returns

null. Nothing (null).

Usage

$result = User_Agent_Info::is_S60_OSSBrowser( $user_agent );
$user_agent(string|null)
User agent string to check. If not provided, uses $_SERVER['HTTP_USER_AGENT'].
Default: null

User_Agent_Info::is_S60_OSSBrowser() code WPSCache 3.1.1

public static function is_S60_OSSBrowser( $user_agent = null ) {
	$user_agent = self::maybe_get_user_agent_from_server( $user_agent );
	if ( empty( $user_agent ) ) {
		return false;
	}

	$agent = strtolower( wp_unslash( $user_agent ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating.
	if ( self::is_opera_mini( $user_agent ) || self::is_opera_mobile( $user_agent ) || self::is_firefox_mobile( $user_agent ) ) {
		return false;
	}

	$pos_webkit = strpos( $agent, 'webkit' );
	if ( false !== $pos_webkit ) {
		// First, test for WebKit, then make sure it's either Symbian or S60.
		if ( strpos( $agent, 'symbian' ) !== false || strpos( $agent, 'series60' ) !== false ) {
				return true;
		} else {
			return false;
		}
	} elseif ( strpos( $agent, 'symbianos' ) !== false && strpos( $agent, 'series60' ) !== false ) {
		return true;
	} elseif ( strpos( $agent, 'nokia' ) !== false && strpos( $agent, 'series60' ) !== false ) {
		return true;
	}

	return false;
}