Automattic\Jetpack\Device_Detection
User_Agent_Info::is_MaemoTablet()
Detects if the current UA is on one of the Maemo-based Nokia Internet Tablets.
Method of the class: User_Agent_Info{}
No Hooks.
Return
null
. Nothing (null).
Usage
$result = User_Agent_Info::is_MaemoTablet();
User_Agent_Info::is_MaemoTablet() User Agent Info::is MaemoTablet code WPSCache 1.12.4
public static function is_MaemoTablet() { 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_maemo = strpos( $agent, 'maemo' ); if ( false === $pos_maemo ) { return false; } // Must be Linux + Tablet, or else it could be something else. if ( strpos( $agent, 'tablet' ) !== false && strpos( $agent, 'linux' ) !== false ) { if ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() ) { return false; } else { return true; } } else { return false; } }