]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
Support for ModCloudFlareIIS.
authorLaurent Destailleur <eldy@destailleur.fr>
Wed, 4 Dec 2013 17:25:09 +0000 (18:25 +0100)
committerLaurent Destailleur <eldy@destailleur.fr>
Wed, 4 Dec 2013 17:25:09 +0000 (18:25 +0100)
wwwroot/cgi-bin/awstats.pl

index 98f3e6bdbdae7ea849debcbe5924baa05486ec2b..e75ceab874f6560519ad9363c5709882df35c918 100644 (file)
@@ -18411,6 +18411,12 @@ if ( $UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft' )
                                4 );
                }
 
+               # Check if there's a CloudFlare Visitor IP in the query string
+               # If it does, replace the ip
+               if ( $pos_query >= 0 && $field[$pos_query] && $field[$pos_query] =~ /\[CloudFlare_Visitor_IP[:](\d+[.]\d+[.]\d+[.]\d+)\]/ ) {
+                       $field[$pos_host] = "$1";
+               }       
+
                # We found a new line
                #----------------------------------------
                if ( $timerecord > $LastLine ) {