aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/comments.pm
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki/Plugin/comments.pm')
-rw-r--r--IkiWiki/Plugin/comments.pm18
1 files changed, 14 insertions, 4 deletions
diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm
index 1c4ab4895..833bedf25 100644
--- a/IkiWiki/Plugin/comments.pm
+++ b/IkiWiki/Plugin/comments.pm
@@ -343,8 +343,6 @@ sub sessioncgi ($$) {
error(gettext("bad page name"));
}
- # FIXME: is this right? Or should we be using the candidate subpage
- # (whatever that might mean) as the base URL?
my $baseurl = urlto($page, undef, 1);
$form->title(sprintf(gettext("commenting on %s"),
@@ -469,9 +467,21 @@ sub sessioncgi ($$) {
}
if ($form->submitted eq POST_COMMENT && $form->validate) {
- my $file = "$location._comment";
-
IkiWiki::checksessionexpiry($cgi, $session);
+
+ $postcomment=1;
+ IkiWiki::check_content(content => $form->field('editcontent'),
+ subject => $form->field('subject'),
+ $config{comments_allowauthor} ? (
+ author => $form->field('author'),
+ url => $form->field('url'),
+ ) : (),
+ page => $location,
+ cgi => $cgi, session => $session
+ );
+ $postcomment=0;
+
+ my $file = "$location._comment";
# FIXME: could probably do some sort of graceful retry
# on error? Would require significant unwinding though