From: eldy <> Date: Mon, 25 May 2009 16:12:09 +0000 (+0000) Subject: robots.txt: clfmerged log files maybe not start with / X-Git-Tag: AWSTATS_6_95_BETA~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c04b3daada29f76db3be804c161eb6e5be712120;p=thirdparty%2FAWStats.git robots.txt: clfmerged log files maybe not start with / --- diff --git a/docs/awstats_changelog.txt b/docs/awstats_changelog.txt index 9ef254cd..ae86fb35 100644 --- a/docs/awstats_changelog.txt +++ b/docs/awstats_changelog.txt @@ -13,7 +13,7 @@ New features/improvements: Fixes: - awstats emmits ton of warnings with new geoipfree - ID: 2794728 - +- fix: can detect robots with robots.txt url even if file is not root. ***** 6.9 ***** diff --git a/wwwroot/cgi-bin/.cvsignore b/wwwroot/cgi-bin/.cvsignore index 68176da6..4c2e9cbd 100644 --- a/wwwroot/cgi-bin/.cvsignore +++ b/wwwroot/cgi-bin/.cvsignore @@ -1,2 +1,3 @@ awstats.testglobal.conf awstats.test*.conf +awstats.conf diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index a23316e2..7d30c02e 100644 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -1578,12 +1578,24 @@ sub GetSessionRange { # Return: -1, 0, 1 #------------------------------------------------------------------------------ sub SortBrowsers { - $a =~ m/^(\w+?)([\d\.]+)?$/; - my $a_family = $1; - my @a_ver = split(/\./, $2); - $b =~ m/^(\w+?)([\d\.]+)?$/; - my $b_family = $1; - my @b_ver = split(/\./, $2); + my $a_family = $a; + my @a_ver = (); + foreach my $family ( keys %BrowsersFamily ) { + if ( $a =~ /^$family/i ) { + $a =~ m/^(\D+)([\d\.]+)?$/; + $a_family = $1; + @a_ver = split(/\./, $2); + } + } + my $b_family = $b; + my @b_ver = (); + foreach my $family ( keys %BrowsersFamily ) { + if ( $b =~ /^$family/i ) { + $b =~ m/^(\D+)([\d\.]+)?$/; + $b_family = $1; + @b_ver = split(/\./, $2); + } + } my $compare = 0; my $done = 0; @@ -10384,7 +10396,7 @@ if ( $UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft' ) # Define precompiled regex my $regmisc = qr/^$miscquoted/; my $regfavico = qr/\/favicon\.ico$/i; - my $regrobot = qr/^\/robots\.txt$/i; + my $regrobot = qr/\/robots\.txt$/i; my $regtruncanchor = qr/#(\w*)$/; my $regtruncurl = qr/([$URLQuerySeparators])(.*)$/; my $regext = qr/\.(\w{1,6})$/;