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

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Mon Jul 21 22:24:00 EDT 2003


User:      jon
Date:      2003-07-22 01:24:36 GMT
Modified:  lib/Vend Interpolate.pm
Log:
Allow timed_build to autocreate directory path when filename with path
component is specified. This makes it easier to do dynamic directories
based on CGI parameters etc. when there are thousands of timed build
files. E.g.:

[timed-build file="timed/@@MV_PAGE@@/[item-code]" minutes=86400] ...

Revision  Changes    Path
2.183     +23 -14    interchange/lib/Vend/Interpolate.pm


rev 2.183, prev_rev 2.182
Index: Interpolate.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Interpolate.pm,v
retrieving revision 2.182
retrieving revision 2.183
diff -u -u -r2.182 -r2.183
--- Interpolate.pm	14 Jul 2003 09:47:26 -0000	2.182
+++ Interpolate.pm	22 Jul 2003 01:24:36 -0000	2.183
@@ -1,6 +1,6 @@
 # Vend::Interpolate - Interpret Interchange tags
 # 
-# $Id: Interpolate.pm,v 2.182 2003/07/14 09:47:26 racke Exp $
+# $Id: Interpolate.pm,v 2.183 2003/07/22 01:24:36 jon Exp $
 #
 # Copyright (C) 2002-2003 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -28,7 +28,7 @@
 require Exporter;
 @ISA = qw(Exporter);
 
-$VERSION = substr(q$Revision: 2.182 $, 10);
+$VERSION = substr(q$Revision: 2.183 $, 10);
 
 @EXPORT = qw (
 
@@ -5256,23 +5256,32 @@
 
 	my $secs;
 	CHECKDIR: {
-		last CHECKDIR if $file;
-		my $dir = 'timed';
-
-		$file = $saved_file || $Vend::Flypart || $Global::Variable->{MV_PAGE};
-#::logDebug("static=$file");
-		if($saved_file) {
-			$file = $saved_file;
-			$file =~ s:^scan/::;
-			$file = generate_key($file);
-			$file = "scan/$file";
+		last CHECKDIR if $file and $file !~ m:/:;
+		my $dir;
+		if ($file) {
+			$dir = '.';
 		}
 		else {
-		 	$saved_file = $file = ($Vend::Flypart || $Global::Variable->{MV_PAGE});
+			$dir = 'timed';
+			$file = $saved_file || $Vend::Flypart || $Global::Variable->{MV_PAGE};
+#::logDebug("static=$file");
+			if($saved_file) {
+				$file = $saved_file;
+				$file =~ s:^scan/::;
+				$file = generate_key($file);
+				$file = "scan/$file";
+			}
+			else {
+				$saved_file = $file = ($Vend::Flypart || $Global::Variable->{MV_PAGE});
+			}
+			$file .= $Vend::Cfg->{HTMLsuffix};
 		}
-		$file .= $Vend::Cfg->{HTMLsuffix};
 		$dir .= "/$1" 
 			if $file =~ s:(.*)/::;
+		unless (allowed_file($dir)) {
+			log_file_violation($dir, 'timed_build');
+			return;
+		}
 		if(! -d $dir) {
 			require File::Path;
 			File::Path::mkpath($dir);







More information about the interchange-cvs mailing list