From de1df1f0b14cdcf4c4ffaa936780614ff1068548 Mon Sep 17 00:00:00 2001 From: Nate Date: Thu, 5 Mar 2020 16:36:06 -0700 Subject: [PATCH] Functions: Mitigate IE warning with update to agent string detection in http_user_agent() function. --- resources/functions.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/functions.php b/resources/functions.php index 6007bf1b84..ef26160d1d 100644 --- a/resources/functions.php +++ b/resources/functions.php @@ -779,7 +779,7 @@ function format_string ($format, $data) { } //get the name of the useragent - if (preg_match('/MSIE/i',$user_agent) && !preg_match('/Opera/i',$user_agent)) { + if (preg_match('/MSIE/i',$user_agent) || preg_match('/Trident/i',$user_agent)) { $browser_name = 'Internet Explorer'; $browser_shortname = 'MSIE'; } @@ -803,6 +803,10 @@ function format_string ($format, $data) { $browser_name = 'Netscape'; $browser_shortname = 'Netscape'; } + else { + $browser_name = 'Unknown'; + $browser_shortname = 'Unknown'; + } //finally get the correct version number $known = array('Version', $browser_shortname, 'other');