From: eldy <> Date: Sat, 11 Jun 2005 19:03:17 +0000 (+0000) Subject: Fixed: [ 1124711 ] env __AWSTATS_CURRENT_CONFIG__ not expanded for include X-Git-Tag: AWSTATS_WEBMIN_1_6_BETA~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd88914fb2d65fc52d071495da7ef60f0b06a0d8;p=thirdparty%2FAWStats.git Fixed: [ 1124711 ] env __AWSTATS_CURRENT_CONFIG__ not expanded for include --- diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index bf54fa2d..ecf12f80 100644 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -1160,6 +1160,10 @@ sub Parse_Config { # Check includes if ($_ =~ /^Include "([^\"]+)"/ || $_ =~ /^#include "([^\"]+)"/) { # #include kept for backward compatibility my $includeFile = $1; + # Expand __var__ by values + while ($includeFile =~ /__([^\s_]+(?:_[^\s_]+)*)__/) { + my $var=$1; $includeFile =~ s/__${var}__/$ENV{$var}/g; + } if ($Debug) { debug("Found an include : $includeFile",2); } if ( $includeFile !~ /^[\\\/]/ ) { # Correct relative include files