aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2010-11-12 00:36:03 -0400
committerJoey Hess <joey@kitenet.net>2010-11-12 00:36:03 -0400
commitd8de98911ec98f9e4560ab2939b4edf8fb04066b (patch)
tree6213d2d5cd219f595e9c92a5b793f279fd540526 /IkiWiki
parent78de33d2eaf8a187b610685f70e60b7d5946374f (diff)
downloadikiwiki-d8de98911ec98f9e4560ab2939b4edf8fb04066b.tar
ikiwiki-d8de98911ec98f9e4560ab2939b4edf8fb04066b.tar.gz
comments: Make comment() pagespec also match comments that are being posted.
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/comments.pm18
1 files changed, 10 insertions, 8 deletions
diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm
index 57f5b1304..a39dab36c 100644
--- a/IkiWiki/Plugin/comments.pm
+++ b/IkiWiki/Plugin/comments.pm
@@ -947,14 +947,16 @@ sub match_comment ($$;@) {
my $page = shift;
my $glob = shift;
- # To see if it's a comment, check the source file type.
- # Deal with comments that were just deleted.
- my $source=exists $IkiWiki::pagesources{$page} ?
- $IkiWiki::pagesources{$page} :
- $IkiWiki::delpagesources{$page};
- my $type=defined $source ? IkiWiki::pagetype($source) : undef;
- if (! defined $type || $type ne "_comment") {
- return IkiWiki::FailReason->new("$page is not a comment");
+ if (! $postcomment) {
+ # To see if it's a comment, check the source file type.
+ # Deal with comments that were just deleted.
+ my $source=exists $IkiWiki::pagesources{$page} ?
+ $IkiWiki::pagesources{$page} :
+ $IkiWiki::delpagesources{$page};
+ my $type=defined $source ? IkiWiki::pagetype($source) : undef;
+ if (! defined $type || $type ne "_comment") {
+ return IkiWiki::FailReason->new("$page is not a comment");
+ }
}
return match_glob($page, "$glob/*", internal => 1, @_);