소스 검색

Functions: Mitigate IE warning with update to agent string detection in http_user_agent() function.

Nate 5 년 전
부모
커밋
a8009ee683
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      resources/functions.php

+ 5 - 1
resources/functions.php

@@ -779,7 +779,7 @@ function format_string ($format, $data) {
 			}
 			}
 
 
 		//get the name of the useragent
 		//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_name = 'Internet Explorer';
 				$browser_shortname = 'MSIE';
 				$browser_shortname = 'MSIE';
 			}
 			}
@@ -803,6 +803,10 @@ function format_string ($format, $data) {
 				$browser_name = 'Netscape';
 				$browser_name = 'Netscape';
 				$browser_shortname = 'Netscape';
 				$browser_shortname = 'Netscape';
 			}
 			}
+			else {
+				$browser_name = 'Unknown';
+				$browser_shortname = 'Unknown';
+			}
 
 
 		//finally get the correct version number
 		//finally get the correct version number
 			$known = array('Version', $browser_shortname, 'other');
 			$known = array('Version', $browser_shortname, 'other');