Delay checking for session expiry til we actually post a comment
authorSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>
Sun, 23 Nov 2008 17:52:30 +0000 (17:52 +0000)
committerSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>
Thu, 11 Dec 2008 21:14:04 +0000 (21:14 +0000)
IkiWiki/Plugin/comments.pm

index 58076938bdffdc337719d2aa986cc1373e4b9a16..d149e598217315aee7621e841417cdc65ea6df1f 100644 (file)
@@ -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);