]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
Fixed: [ 1124711 ] env __AWSTATS_CURRENT_CONFIG__ not expanded for include
authoreldy <>
Sat, 11 Jun 2005 19:03:17 +0000 (19:03 +0000)
committereldy <>
Sat, 11 Jun 2005 19:03:17 +0000 (19:03 +0000)
wwwroot/cgi-bin/awstats.pl

index bf54fa2d50e000ab0d3a3cb72817a9ce37ffc98d..ecf12f80b209921098f3650924f9c2193525264f 100644 (file)
@@ -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