aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2010-04-28 12:39:13 -0400
committerJoey Hess <joey@kitenet.net>2010-04-28 12:39:13 -0400
commita6e6f604bd8e9a8f90000163f8b00299829729d5 (patch)
tree05488793516ed936a3eb0dcb22c490623db7580e /IkiWiki.pm
parent67e8edc59712cfc3dbd24fd7f3aae0fa734983be (diff)
downloadikiwiki-a6e6f604bd8e9a8f90000163f8b00299829729d5.tar
ikiwiki-a6e6f604bd8e9a8f90000163f8b00299829729d5.tar.gz
TMPL_INCLUDE re-enabled for templates read from the templatedir. (But not in-wiki templates.)
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r--IkiWiki.pm18
1 files changed, 11 insertions, 7 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index 623396c9c..dcee376ee 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -1661,7 +1661,11 @@ sub template_file ($) {
}
my $template=srcfile($tpage, 1);
- if (! defined $template) {
+ if (defined $template) {
+ return $template, $tpage, 1 if wantarray;
+ return $template;
+ }
+ else {
$name=~s:/::; # avoid path traversal
foreach my $dir ($config{templatedir},
"$installdir/share/ikiwiki/templates") {
@@ -1670,12 +1674,12 @@ sub template_file ($) {
last;
}
}
+ if (defined $template) {
+ return $template, $tpage if wantarray;
+ return $template;
+ }
}
- if (defined $template) {
- return $template, $tpage if wantarray;
- return $template;
- }
return;
}
@@ -1683,7 +1687,7 @@ sub template_depends ($$;@) {
my $name=shift;
my $page=shift;
- my ($filename, $tpage)=template_file($name);
+ my ($filename, $tpage, $untrusted)=template_file($name);
if (defined $page && defined $tpage) {
add_depends($page, $tpage);
}
@@ -1699,7 +1703,7 @@ sub template_depends ($$;@) {
die_on_bad_params => 0,
filename => $filename,
@_,
- no_includes => 1,
+ ($untrusted ? (no_includes => 1) : ()),
);
return @opts if wantarray;