summaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/comments.pm4
-rw-r--r--IkiWiki/Plugin/editpage.pm4
-rw-r--r--IkiWiki/Plugin/rename.pm1
3 files changed, 5 insertions, 4 deletions
diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm
index 1287590a7..d9183970d 100644
--- a/IkiWiki/Plugin/comments.pm
+++ b/IkiWiki/Plugin/comments.pm
@@ -364,8 +364,8 @@ sub editcomment ($$) {
}
# The untaint is OK (as in editpage) because we're about to pass
- # it to file_pruned anyway
- my $page = $form->field('page');
+ # it to file_pruned and wiki_file_regexp anyway.
+ my $page = $form->field('page')=~/$config{wiki_file_regexp}/;
$page = IkiWiki::possibly_foolish_untaint($page);
if (! defined $page || ! length $page ||
IkiWiki::file_pruned($page)) {
diff --git a/IkiWiki/Plugin/editpage.pm b/IkiWiki/Plugin/editpage.pm
index df29bcc98..8c78e853c 100644
--- a/IkiWiki/Plugin/editpage.pm
+++ b/IkiWiki/Plugin/editpage.pm
@@ -91,12 +91,12 @@ sub cgi_editpage ($$) {
# This untaint is safe because we check file_pruned and
# wiki_file_regexp.
my ($page)=$form->field('page')=~/$config{wiki_file_regexp}/;
- $page=possibly_foolish_untaint($page);
- my $absolute=($page =~ s#^/+##); # absolute name used to force location
if (! defined $page || ! length $page ||
file_pruned($page)) {
error(gettext("bad page name"));
}
+ $page=possibly_foolish_untaint($page);
+ my $absolute=($page =~ s#^/+##); # absolute name used to force location
my $baseurl = urlto($page);
diff --git a/IkiWiki/Plugin/rename.pm b/IkiWiki/Plugin/rename.pm
index 57747d3c9..e871b815d 100644
--- a/IkiWiki/Plugin/rename.pm
+++ b/IkiWiki/Plugin/rename.pm
@@ -567,6 +567,7 @@ sub fixlinks ($$$) {
}
if ($needfix) {
my $file=$pagesources{$page};
+ next unless -e $config{srcdir}."/".$file;
my $oldcontent=readfile($config{srcdir}."/".$file);
my $content=renamepage_hook($page, $rename->{src}, $rename->{dest}, $oldcontent);
if ($oldcontent ne $content) {