]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
Fix: If there is no referer field in the log format, do not use them in the errors...
authoreldy <>
Fri, 18 Feb 2005 19:13:08 +0000 (19:13 +0000)
committereldy <>
Fri, 18 Feb 2005 19:13:08 +0000 (19:13 +0000)
wwwroot/cgi-bin/awstats.pl

index 9a7a05d6ebe2f40d5de383a98baf670e7cb4daf5..3a88bf78f820b8c842197a61fcfa26d912f7ca79 100644 (file)
@@ -1551,8 +1551,8 @@ sub Check_Config {
        $DirData||='.';
        $DirCgi||='/cgi-bin';
        $DirIcons||='/icon';
-       if ($DNSLookup !~ /[0-2]/)                      { error("DNSLookup parameter is wrong in config/domain file. Value is '$DNSLookup' (should be 0 or 1)"); }
-       if (! $SiteDomain)                              { error("SiteDomain parameter not defined in your config/domain file. You must add it for using this version of AWStats."); }
+       if ($DNSLookup !~ /[0-2]/)                      { error("DNSLookup parameter is wrong in config/domain file. Value is '$DNSLookup' (should be 0,1 or 2)"); }
+       if (! $SiteDomain)                              { error("SiteDomain parameter not defined in your config/domain file. You must edit it for using this version of AWStats."); }
        if ($AllowToUpdateStatsFromBrowser !~ /[0-1]/)  { $AllowToUpdateStatsFromBrowser=0; }
        if ($AllowFullYearView !~ /[0-3]/)                              { $AllowFullYearView=2; }
        # Optional setup section
@@ -6370,10 +6370,12 @@ if ($UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft') {        # Updat
                                                my $newurl=substr($field[$pos_url],0,$MaxLengthOfStoredURL);
                                                $newurl =~ s/[$URLQuerySeparators].*$//;
                                                $_sider404_h{$newurl}++;
-                                               my $newreferer=$field[$pos_referer];
-                                               if (! $URLReferrerWithQuery) { $newreferer =~ s/[$URLQuerySeparators].*$//; }
-                                               $_referer404_h{$newurl}=$newreferer;
-                                               last;
+                                               if ($pos_referer >= 0) {
+                                               my $newreferer=$field[$pos_referer];
+                                               if (! $URLReferrerWithQuery) { $newreferer =~ s/[$URLQuerySeparators].*$//; }
+                                               $_referer404_h{$newurl}=$newreferer;
+                                               last;
+                                       }
                                        }
                                }
                                if ($Debug) { debug(" Record stored in the status code chart (status code=$field[$pos_code])",2); }