From: Simon McVittie Date: Sun, 23 Nov 2008 17:52:30 +0000 (+0000) Subject: Delay checking for session expiry til we actually post a comment X-Git-Tag: 2.71~111 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/80e84e32bf98ed76d0e207e414035b36b9232191 Delay checking for session expiry til we actually post a comment --- diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 58076938b..d149e5982 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -264,7 +264,6 @@ sub sessioncgi ($$) { #{{{ $page)); } - IkiWiki::checksessionexpiry($session, $cgi->param('sid')); IkiWiki::check_canedit($page . "[postcomment]", $cgi, $session); my ($authorurl, $author) = linkuser(getcgiuser($session)); @@ -354,6 +353,8 @@ sub sessioncgi ($$) { #{{{ if ($form->submitted eq POST_COMMENT && $form->validate) { my $file = "$location._comment"; + IkiWiki::checksessionexpiry($session, $cgi->param('sid')); + # FIXME: could probably do some sort of graceful retry # on error? Would require significant unwinding though writefile($file, $config{srcdir}, $content);