summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/comments.pm
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki/Plugin/comments.pm')
-rw-r--r--IkiWiki/Plugin/comments.pm16
1 files changed, 7 insertions, 9 deletions
diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm
index 63e9ab499..6691dbafa 100644
--- a/IkiWiki/Plugin/comments.pm
+++ b/IkiWiki/Plugin/comments.pm
@@ -364,16 +364,14 @@ 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)) {
error(gettext("bad page name"));
}
- my $baseurl = urlto($page);
-
$form->title(sprintf(gettext("commenting on %s"),
IkiWiki::pagetitle(IkiWiki::basename($page))));
@@ -385,7 +383,7 @@ sub editcomment ($$) {
if ($form->submitted eq CANCEL) {
# bounce back to the page they wanted to comment on, and exit.
- IkiWiki::redirect($cgi, $baseurl);
+ IkiWiki::redirect($cgi, urlto($page));
exit;
}
@@ -506,7 +504,7 @@ sub editcomment ($$) {
IkiWiki::saveindex();
IkiWiki::printheader($session);
- print IkiWiki::misctemplate(gettext(gettext("comment stored for moderation")),
+ print IkiWiki::cgitemplate($cgi, gettext(gettext("comment stored for moderation")),
"<p>".
gettext("Your comment will be posted after moderator review").
"</p>");
@@ -556,8 +554,8 @@ sub editcomment ($$) {
}
else {
- IkiWiki::showform ($form, \@buttons, $session, $cgi,
- forcebaseurl => $baseurl, page => $page);
+ IkiWiki::showform($form, \@buttons, $session, $cgi,
+ page => $page);
}
exit;
@@ -662,7 +660,7 @@ sub commentmoderation ($$) {
IkiWiki::run_hooks(format => sub {
$out = shift->(page => "", content => $out);
});
- print IkiWiki::misctemplate(gettext("comment moderation"), $out);
+ print IkiWiki::cgitemplate($cgi, gettext("comment moderation"), $out);
exit;
}