[interchange-cvs] interchange - racke modified lib/Vend/Interpolate.pm

interchange-core@icdevgroup.org interchange-core@icdevgroup.org
Fri Nov 29 06:56:01 2002


User:      racke
Date:      2002-11-29 11:55:43 GMT
Modified:  lib/Vend Tag: STABLE_4_8-branch Interpolate.pm
Log:
adhere Global::NoAbsolute setting in timed_build

Revision  Changes    Path
No                   revision



No                   revision



2.9.2.22  +8 -2      interchange/lib/Vend/Interpolate.pm


rev 2.9.2.22, prev_rev 2.9.2.21
Index: Interpolate.pm
===================================================================
RCS file: /anon_cvs/repository/interchange/lib/Vend/Interpolate.pm,v
retrieving revision 2.9.2.21
retrieving revision 2.9.2.22
diff -u -r2.9.2.21 -r2.9.2.22
--- Interpolate.pm	26 Nov 2002 03:21:10 -0000	2.9.2.21
+++ Interpolate.pm	29 Nov 2002 11:55:42 -0000	2.9.2.22
@@ -1,6 +1,6 @@
 # Vend::Interpolate - Interpret Interchange tags
 # 
-# $Id: Interpolate.pm,v 2.9.2.21 2002/11/26 03:21:10 jon Exp $
+# $Id: Interpolate.pm,v 2.9.2.22 2002/11/29 11:55:42 racke Exp $
 #
 # Copyright (C) 1996-2002 Red Hat, Inc. and
 # Interchange Development Group, http://www.icdevgroup.org/
@@ -28,7 +28,7 @@
 require Exporter;
 @ISA = qw(Exporter);
 
-$VERSION = substr(q$Revision: 2.9.2.21 $, 10);
+$VERSION = substr(q$Revision: 2.9.2.22 $, 10);
 
 @EXPORT = qw (
 
@@ -6334,6 +6334,12 @@
 	elsif ($opt->{period}) {
 		$secs = Vend::Config::time_to_seconds($opt->{period});
 	}
+
+	if($Global::NoAbsolute and (file_name_is_absolute($file) or $file =~ m#\.\./.*\.\.#)) {
+		::logError("Can't use file '%s' with NoAbsolute set", $file);
+		::logGlobal({ level => 'auth'}, "Can't use file '%s' with NoAbsolute set", $file);
+		return '';
+    }
 
     if( ! -f $file or $secs && (stat(_))[9] < (time() - $secs) ) {
         my $out = Vend::Interpolate::interpolate_html(shift);