Automattic\Jetpack\Device_Detection

User_Agent_Info::__construct()publicWPSCache 1.0

The constructor.

{} It's a method of the class: User_Agent_Info{}

No Hooks.

Return

null. Nothing.

Usage

$User_Agent_Info = new User_Agent_Info();
$User_Agent_Info->__construct( $ua );
$ua(string)
(Optional) User agent.
Default: ''

Code of User_Agent_Info::__construct() WPSCache 1.9.1

public function __construct( $ua = '' ) {
	if ( $ua ) {
		$this->useragent = $ua;
	} else {
		if ( ! empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
			$this->useragent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This class is all about validating.
		}
	}
}