Skip to content

Commit

Permalink
Merge branch 'mynetx/browser-detection'
Browse files Browse the repository at this point in the history
  • Loading branch information
mynetx committed Apr 8, 2013
2 parents fdb2daf + c3e8a8c commit 07855be
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
4 changes: 2 additions & 2 deletions libraries/Config.class.php
Expand Up @@ -216,9 +216,9 @@ function checkClient()
'@Mozilla/([0-9].[0-9]{1,2})@',
$HTTP_USER_AGENT,
$log_version)
&& preg_match('@Chrome/([0-9]*)@', $HTTP_USER_AGENT, $log_version2)
&& preg_match('@Chrome/([0-9.]*)@', $HTTP_USER_AGENT, $log_version2)
) {
$this->set('PMA_USR_BROWSER_VER', $log_version[1] . '.' . $log_version2[1]);
$this->set('PMA_USR_BROWSER_VER', $log_version2[1]);
$this->set('PMA_USR_BROWSER_AGENT', 'CHROME');
// newer Safari
} elseif (preg_match(
Expand Down
36 changes: 30 additions & 6 deletions test/classes/PMA_Config_test.php
Expand Up @@ -127,6 +127,30 @@ public function userAgentProvider()
'IE',
'8.0',
),
array(
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Win',
'IE',
'9.0',
),
array(
'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; Trident/6.0)',
'Win',
'IE',
'10.0',
),
array(
'Mozilla/5.0 (IE 11.0; Windows NT 6.3; Trident/7.0; .NET4.0E; .NET4.0C; rv:11.0) like Gecko',
'Win',
'IE',
'11.0',
),
array(
'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',
'Win',
'CHROME',
'25.0.1364.172',
),
array(
'Mozilla/5.0 (Unknown; U; Unix BSD/SYSV system; C -) AppleWebKit/527+ (KHTML, like Gecko, Safari/419.3) Arora/0.10.2',
'Unix',
Expand All @@ -147,18 +171,18 @@ public function userAgentProvider()
array(
'Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20100101 Firefox/5.0',
'Linux',
'MOZILLA',
'FIREFOX',
'5.0',
),
/**
* @todo Is this version really expected?
*/
array(
'Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20100101 Firefox/12.0',
'Linux',
'MOZILLA',
'5.0',
'FIREFOX',
'12.0',
),
/**
* @todo Is this version really expected?
*/
array(
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.4+ (KHTML, like Gecko) Version/5.0 Safari/535.4+ SUSE/12.1 (3.2.1) Epiphany/3.2.1',
'Linux',
Expand Down

0 comments on commit 07855be

Please sign in to comment.