Version 4.3.0
This commit is contained in:
1 parent
96997ddd8e
commit
fe1acf984a
1349 files changed
+116159
-67711
No files matched your search
@@ -52,6 +52,11 @@ class _Useragent
|
||||
*/
|
||||
public $useragent = NULL;
|
||||
|
||||
/**
|
||||
* @brief Store parsed agents
|
||||
*/
|
||||
protected static $parsedAgents = array();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@@ -72,11 +77,16 @@ class _Useragent
|
||||
public static function parse( $userAgent=NULL )
|
||||
{
|
||||
$userAgent = $userAgent ?: ( ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) ? $_SERVER['HTTP_USER_AGENT'] : '' );
|
||||
|
||||
if ( ! isset( static::$parsedAgents[ $userAgent ] ) )
|
||||
{
|
||||
$obj = new static( $userAgent );
|
||||
$obj->parseUserAgent();
|
||||
|
||||
$obj = new static( $userAgent );
|
||||
$obj->parseUserAgent();
|
||||
|
||||
return $obj;
|
||||
static::$parsedAgents[ $userAgent ] = $obj;
|
||||
}
|
||||
|
||||
return static::$parsedAgents[ $userAgent ];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user