From d8255179d8223718e9591e1a4c5ba9c860f74ed2 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 26 Oct 2015 21:43:08 +0000 Subject: [PATCH] detecting MS Edge as html::$user_agent="edge" and html::$ua_version="12.*", even if some report only "Mozilla/5.0 (Windows NT 10.0; Win64; x64)" --- phpgwapi/inc/class.html.inc.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/phpgwapi/inc/class.html.inc.php b/phpgwapi/inc/class.html.inc.php index 7704c18947..fe8218f854 100644 --- a/phpgwapi/inc/class.html.inc.php +++ b/phpgwapi/inc/class.html.inc.php @@ -69,7 +69,7 @@ class html $parts = array_pop($all_parts); foreach($all_parts as $p) { - if ($p[1] == 'Chrome') + if ($p[1] == 'Chrome' && $parts[1] != 'Edge') { $parts = $p; break; @@ -91,6 +91,12 @@ class html { self::$user_agent = 'firefox'; } + // MS Edge sometimes reports just "Mozilla/5.0 (Windows NT 10.0; Win64; x64)" + if (self::$user_agent == 'mozilla' && self::$ua_version == '5.0') + { + self::$user_agent = 'edge'; + self::$ua_version = '12.0'; + } self::$ua_mobile = preg_match('/(iPhone|iPod|iPad|Android|SymbianOS|Blackberry|Kindle|Opera Mobi|Windows Phone)/i', $_SERVER['HTTP_USER_AGENT'], $matches) ? strtolower($matches[1]) : null;