Skip to content

Commit 6bde9ef

Browse files
authored
Merge pull request cbschuld#57 from Otamay/master
Detects if MSIE is IE7, 8, 9, 10 and 11
2 parents b840b77 + 3c4c13b commit 6bde9ef

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

lib/Browser.php

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,27 @@ protected function checkBrowserInternetExplorer()
918918
if (isset($aresult[1])) {
919919
$this->setBrowser(self::BROWSER_IE);
920920
$this->setVersion(str_replace(array('(', ')', ';'), '', $aresult[1]));
921-
if (stripos($this->_agent, 'IEMobile') !== false) {
921+
if(preg_match('#trident/([0-9\.]+);#i', $this->_agent, $aresult)){
922+
if($aresult[1] == '3.1'){
923+
$this->setVersion('7.0');
924+
}
925+
else if($aresult[1] == '4.0'){
926+
$this->setVersion('8.0');
927+
}
928+
else if($aresult[1] == '5.0'){
929+
$this->setVersion('9.0');
930+
}
931+
else if($aresult[1] == '6.0'){
932+
$this->setVersion('10.0');
933+
}
934+
else if($aresult[1] == '7.0'){
935+
$this->setVersion('11.0');
936+
}
937+
else if($aresult[1] == '8.0'){
938+
$this->setVersion('11.0');
939+
}
940+
}
941+
if(stripos($this->_agent, 'IEMobile') !== false) {
922942
$this->setBrowser(self::BROWSER_POCKET_IE);
923943
$this->setMobile(true);
924944
}

0 commit comments

Comments
 (0)