From 941fb8a11dc91bfd0951272fd4d04736936980b2 Mon Sep 17 00:00:00 2001 From: Udo Spallek Date: Tue, 28 Feb 2006 20:50:27 +0000 Subject: [PATCH] Erweiterung des <%include FILE%> Befehls um die Moeglichkeit ein Verzeichnis unterhalb von $template_dir angeben zu koennen. Die alte Funktionsweise bleibt unangetastet. Die neue Syntax lautet <%include DIR/SUBDIR/FILENAME%>. --- SL/Form.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SL/Form.pm b/SL/Form.pm index b7b76e4c2..a9c7225ea 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -939,12 +939,12 @@ sub parse_template { # check for <%include filename%> if (/\s*<%include /) { - # get the filename + # get the directory/filename chomp $var; $var =~ s/\s*<%include (.+?)%>/$1/; - # mangle filename - $var =~ s/(\/|\.\.)//g; + # mangle filename on basedir + $var =~ s/^(\/|\.\.)//g; # prevent the infinite loop! next if ($self->{"$var"}); -- 2.20.1