Why does ie8's user agent return 'opera'?
-
06-07-2019 - |
Question
My code at: http://www.mgxvideo.com/mgxcopy-dev/get_browser.php, returns Opera when I run IE8. My source is:
<?php
$browser = get_browser(null, true);
echo $browser['browser'];
?>
Solution
It doesn't. The get_browser()
function is making educated (but ill-informed) guesses about which browser the user-agent is running. Your browser capabilities file is likely outdated, probably because it was made before IE8 was released. Update it here.
The real IE8 user-agent string looks something like this:
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)
OTHER TIPS
You should use a lower-level tool, like a packet trace or server logging or a header dump to see what is being sent.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow