Automattic\Jetpack\Device_Detection
User_Agent_Info::is_S60_OSSBrowser()
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
Метод класса: User_Agent_Info{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$result = User_Agent_Info::is_S60_OSSBrowser();
Код User_Agent_Info::is_S60_OSSBrowser() User Agent Info::is S60 OSSBrowser WPSCache 1.12.4
public static function is_S60_OSSBrowser() { 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. if ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() ) { 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; }