From da9d788a9059ee88240cbbcc5096abc553b1cf1f Mon Sep 17 00:00:00 2001 From: "P. J. McDermott" Date: Sun, 22 Sep 2013 17:13:25 -0400 Subject: [PATCH] Set SCRIPT_FILENAME. --- src/ssic.pl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ssic.pl b/src/ssic.pl index c12ff21..d678556 100644 --- a/src/ssic.pl +++ b/src/ssic.pl @@ -105,6 +105,7 @@ sub compile { my ($input, $output, $vars, $root) = @_; my $input_fh; + my $input_abs; my $output_fh; my $ssi; my $var_name; @@ -116,10 +117,12 @@ sub compile if ($input eq "-") { $input_fh = *STDIN; + $input_abs = File::Spec->rel2abs("."); } else { if (not open($input_fh, "<", $input)) { error(4, "%s: %s\n", $input, $!); } + $input_abs = File::Spec->rel2abs($input); } if ($output eq "-") { $output_fh = *STDOUT; @@ -129,10 +132,12 @@ sub compile } } + # CGI::SSI uses SCRIPT_FILENAME to determine the value of LAST_MODIFIED. %ENV = ( "DOCUMENT_NAME" => $input, "DOCUMENT_URI" => $input, "DOCUMENT_ROOT" => $root, + "SCRIPT_FILENAME" => $input_abs, ); $CGI::SSI::DEBUG = 0; -- 2.31.1