-
Bug
-
Resolution: Fixed
-
Minor
-
2.1.4, 2.2.1, 2.3
-
MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
-
MOODLE_21_STABLE, MOODLE_22_STABLE
-
MDL-31482-master -
The get_device_type function includes this code:
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6.') !== false) {
|
return 'legacy';
|
}
|
Unfortunately this logic misdetects IE7/8 as IE6 under certain circumstances. In my testing, approximately 1.5% of users with MSIE7 or MSIE8 have user-agent strings that also contain the string 'MSIE 6.'.
Here is an example user agent:
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; BT Openworld BB; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; Hotbar 10.2.197.0; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 2.0.50727)
Obviously this user agent string is completely broken. Agents like this (there are many different cases with no obvious common factors, other than the symptom of a 'nested' IE6 user agent) are common.
Microsoft have fixed this problem in IE9 which doesn't add crap all over its user agent, so it is only MSIE 7 and MSIE 8 that are affected.
(Yes we discovered this after doing something drastic so that our pages could sort of display in IE6... and then getting a bunch of helpdesk calls from irate IE7/8 users. Ooops.)