summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e9797ee)
I think that using a flag variable is sorta cleaner.
(This is untested.)
use constant POST_COMMENT => "Post comment";
use constant CANCEL => "Cancel";
use constant POST_COMMENT => "Post comment";
use constant CANCEL => "Cancel";
sub import { #{{{
hook(type => "checkconfig", id => 'comments', call => \&checkconfig);
hook(type => "getsetup", id => 'comments', call => \&getsetup);
sub import { #{{{
hook(type => "checkconfig", id => 'comments', call => \&checkconfig);
hook(type => "getsetup", id => 'comments', call => \&getsetup);
- IkiWiki::check_canedit($page . "[postcomment]", $cgi, $session);
+ # Set a flag to indicate that we're posting a comment,
+ # so that postcomment() can tell it should match.
+ $postcomment=1;
+ IkiWiki::check_canedit($page, $cgi, $session);
+ $postcomment=0;
my $editcontent = $form->field('editcontent') || '';
$editcontent =~ s/\r\n/\n/g;
my $editcontent = $form->field('editcontent') || '';
$editcontent =~ s/\r\n/\n/g;
my $page = shift;
my $glob = shift;
my $page = shift;
my $glob = shift;
- unless ($page =~ s/\[postcomment\]$//) {
return IkiWiki::FailReason->new("not posting a comment");
}
return match_glob($page, $glob);
return IkiWiki::FailReason->new("not posting a comment");
}
return match_glob($page, $glob);