@anonymous-matomo-user opened this Issue on August 10th 2011

all of our IE8 are detected as IE7 in UserAgents because they are running in compatibility mode. it would be nice to have those browsers recodgnised as "IE8 Compatibility" and not as IE7. i have patched UserAgentParser.php

        // Misbehaving IE add-ons
        $userAgent = preg_replace('/[; ]Mozilla\/[0-9.]+ \([^)]+\)/', '', $userAgent);
// IE 8 in compatibility mode on xp, vista and win7
        $userAgent = preg_replace('/MSIE 7.0; Windows NT 5.1; Trident\/4.0/', 'MSIE 8.0; Windows NT 5.1; Trident/4.0', $userAgent);
        $userAgent = preg_replace('/MSIE 7.0; Windows NT 6.0; Trident\/4.0/', 'MSIE 8.0; Windows NT 6.0; Trident/4.0', $userAgent);
        $userAgent = preg_replace('/MSIE 7.0; Windows NT 6.1; Trident\/4.0/', 'MSIE 8.0; Windows NT 6.0; Trident/4.0', $userAgent);

i also patched UserAgentParser.test.php to have ie8 on winxp

    'ie8 on vista' => 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0)',
    'ie8 on winxp' => 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; ',

so with this IE8 as returned. maybe it would be better to return it as "IE8 in Compatibility Mode".

markus

@robocoder commented on August 12th 2011 Contributor

(In [5105]) fixes #2621 but UserAgentParser could use some love

@anonymous-matomo-user commented on July 30th 2013

Hello @Markus!

Unfortunately this problem still persists in the latest version (1.12). On an intranet (my case) the Browser Version report is useless this way.

I tried using your patch, but I got no success... Please, could you post a new patch?

@robocoder commented on August 7th 2013 Contributor

Please open a new ticket with the User Agent that's failing.

tests/PHPUnit/Plugins/UserSettingsTest.php contains compatibility mode User Agent strings showing the actual browser version is detected (instead of the reported compatibility mode).

@anonymous-matomo-user commented on August 7th 2013

I'll do it. Thank you for putting me in the right direction.

Sorry for the noise!

This Issue was closed on August 7th 2013
Powered by GitHub Issue Mirror