Skip to content

Commit

Permalink
Merge pull request #57 from Otamay/master
Browse files Browse the repository at this point in the history
Detects if MSIE is IE7, 8, 9, 10 and 11
  • Loading branch information
cbschuld committed Jul 31, 2017
2 parents b840b77 + 3c4c13b commit 6bde9ef
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion lib/Browser.php
Expand Up @@ -918,7 +918,27 @@ protected function checkBrowserInternetExplorer()
if (isset($aresult[1])) {
$this->setBrowser(self::BROWSER_IE);
$this->setVersion(str_replace(array('(', ')', ';'), '', $aresult[1]));
if (stripos($this->_agent, 'IEMobile') !== false) {
if(preg_match('#trident/([0-9\.]+);#i', $this->_agent, $aresult)){
if($aresult[1] == '3.1'){
$this->setVersion('7.0');
}
else if($aresult[1] == '4.0'){
$this->setVersion('8.0');
}
else if($aresult[1] == '5.0'){
$this->setVersion('9.0');
}
else if($aresult[1] == '6.0'){
$this->setVersion('10.0');
}
else if($aresult[1] == '7.0'){
$this->setVersion('11.0');
}
else if($aresult[1] == '8.0'){
$this->setVersion('11.0');
}
}
if(stripos($this->_agent, 'IEMobile') !== false) {
$this->setBrowser(self::BROWSER_POCKET_IE);
$this->setMobile(true);
}
Expand Down

0 comments on commit 6bde9ef

Please sign in to comment.