Version 4.7.13
This commit is contained in:
1 parent
fd22d99e69
commit
7124a02564
954 files changed
+29277
-59308
No files matched your search
@@ -91,26 +91,9 @@ class _Useragent
|
||||
*/
|
||||
public function parseUserAgent()
|
||||
{
|
||||
/* Is it ours? */
|
||||
if ( preg_match( '/^InvisionCommunityApp\/(\d+\.\d+\.\d+) \((.+?)\) (.+?) \((.+?)\)$/', $this->useragent, $matches ) ) // Matches: 1 = App version, 2 = App name (differentiates multicommunity vs white-label) 3 = "Android" or "iOS/X.Y.Z" 4 = Semi-human-friendly name (e.g. "iPhone11,6" is iPhone XS Max)
|
||||
{
|
||||
if ( $matches[3] === 'Android' )
|
||||
{
|
||||
$this->platform = $matches[4];
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->platform = preg_replace( '/^(.+?)\d+,\d+$/', '$1', $matches[4] );
|
||||
}
|
||||
|
||||
$this->browser = 'InvisionCommunityApp';
|
||||
$this->browserVersion = $matches[1];
|
||||
return;
|
||||
}
|
||||
|
||||
/* Set basic data */
|
||||
require_once( \IPS\ROOT_PATH . '/system/3rd_party/PhpUserAgent/UserAgentParser.php' );
|
||||
$data = parse_user_agent( $this->useragent );
|
||||
$data = \donatj\UserAgent\parse_user_agent( $this->useragent );
|
||||
$this->platform = $data['platform'];
|
||||
$this->browser = $data['browser'];
|
||||
$this->browserVersion = $data['version'];
|
||||
|
||||
Reference in new issue
Block a user