From b888c1c0cc36c0083f444b5afd0a2011b88d3af8 Mon Sep 17 00:00:00 2001 From: Metalmate Date: Fri, 4 Jul 2014 00:29:32 +0200 Subject: [PATCH 1/2] Update Browser.php --- lib/Browser.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/Browser.php b/lib/Browser.php index 9583cc4..98cd6eb 100644 --- a/lib/Browser.php +++ b/lib/Browser.php @@ -4,7 +4,7 @@ /** * File: Browser.php * Author: Chris Schuld (http://chrisschuld.com/) - * Last Modified: August 20th, 2010 + * Last Modified: July 4th, 2014 * @version 1.9 * @package PegasusPHP * @@ -565,9 +565,14 @@ protected function checkBrowserSlurp() */ protected function checkBrowserInternetExplorer() { - + // Test for IE11 + if( stripos($this->_agent,'Trident/7.0; rv:11.0') !== false ) { + $this->setBrowser(self::BROWSER_IE); + $this->setVersion('11.0'); + return true; + } // Test for v1 - v1.5 IE - if (stripos($this->_agent, 'microsoft internet explorer') !== false) { + else if (stripos($this->_agent, 'microsoft internet explorer') !== false) { $this->setBrowser(self::BROWSER_IE); $this->setVersion('1.0'); $aresult = stristr($this->_agent, '/'); From 282db86cfdf1c844cb0fce9f0c43e8e7a2e99a19 Mon Sep 17 00:00:00 2001 From: Marco Cheung Date: Wed, 9 Jul 2014 03:03:48 +0800 Subject: [PATCH 2/2] Fix for detect IE11 The previous code can detect IE11. But missing the return true statement, so the result goes wrong. Fixed for now. --- lib/Browser.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/Browser.php b/lib/Browser.php index 98cd6eb..de4c2b2 100644 --- a/lib/Browser.php +++ b/lib/Browser.php @@ -565,14 +565,9 @@ protected function checkBrowserSlurp() */ protected function checkBrowserInternetExplorer() { - // Test for IE11 - if( stripos($this->_agent,'Trident/7.0; rv:11.0') !== false ) { - $this->setBrowser(self::BROWSER_IE); - $this->setVersion('11.0'); - return true; - } + // Test for v1 - v1.5 IE - else if (stripos($this->_agent, 'microsoft internet explorer') !== false) { + if (stripos($this->_agent, 'microsoft internet explorer') !== false) { $this->setBrowser(self::BROWSER_IE); $this->setVersion('1.0'); $aresult = stristr($this->_agent, '/'); @@ -602,7 +597,11 @@ protected function checkBrowserInternetExplorer() $this->setBrowser(self::BROWSER_IE); $result = explode('rv:', $this->_agent); $this->setVersion(preg_replace('/[^0-9.]+/', '', $result[1])); - $this->_agent = str_replace(array("Mozilla", "Gecko"), "MSIE", $this->_agent); + if(stripos($this->_agent, 'IEMobile') !== false) { + $this->setBrowser(self::BROWSER_POCKET_IE); + $this->setMobile(true); + } + return true; } // Test for Pocket IE else if (stripos($this->_agent, 'mspie') !== false || stripos($this->_agent, 'pocket') !== false) { $aresult = explode(' ', stristr($this->_agent, 'mspie'));