MSIE 11 regex

Developers
2014-01-22
2014-01-24
  • Andrew Hadenfeldt

    I would like to propose a change for the MSIE 11 matching to allow it to match regardless of OS version. This patch is for develop and is based on the existing MSIE logic.

    Thank you,
    -Andy

    diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl
    index 2a46e2f..50a7b47 100644
    --- a/wwwroot/cgi-bin/awstats.pl
    +++ b/wwwroot/cgi-bin/awstats.pl
    @@ -17880,6 +17880,7 @@ if ( $UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft' )
        my $regipv4l          = qr/^::ffff:\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;
        my $regipv6           = qr/^[0-9A-F]*:/i;
        my $regvermsie        = qr/msie([+_ ]|)([\d\.]*)/i;
    +   my $regvermsie11      = qr/trident\/7\.\d*\;([+_ ]|)rv:([\d\.]*)/i;
        my $regvernetscape    = qr/netscape.?\/([\d\.]*)/i;
        my $regverfirefox     = qr/firefox\/([\d\.]*)/i;
        # For Opera:
    @@ -19491,11 +19492,12 @@ if ( $UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft' )
                            }
    
                            # IE 11
    -                       elsif ($UserAgent eq "Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko")
    +                       elsif ($UserAgent =~ /$regvermsie11/o
    +                           && $UserAgent !~ /$regnotie/o )
                            {
    -                           $_browser_h{"msie11"}++;
    -                           if ($PageBool) { $_browser_p{"msie11"}++; }
    -                           $TmpBrowser{$UserAgent} = "msie11";
    +                           $_browser_h{"msie$2"}++;
    +                           if ($PageBool) { $_browser_p{"msie$2"}++; }
    +                           $TmpBrowser{$UserAgent} = "msie$2";
                            }
    
                            # Netscape 6.x, 7.x ... ? (must be at end of test)
    
     
  • Laurent Destailleur (Eldy)

    Thanks i added patch to git sources.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks