summaryrefslogtreecommitdiff
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, 10 insertions, 8 deletions
diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm
index eb861d74f..de193bd12 100644
--- a/IkiWiki/Plugin/comments.pm
+++ b/IkiWiki/Plugin/comments.pm
@@ -908,10 +908,12 @@ sub match_comment ($$;@) {
my $page = shift;
my $glob = shift;
- if (! IkiWiki::isinternal($page)) {
- return IkiWiki::FailReason->new("$page is not a comment");
- }
- my $type=IkiWiki::pagetype($IkiWiki::pagesources{$page});
+ # 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=IkiWiki::pagetype($source);
if (defined $type && $type ne "_comment") {
return IkiWiki::FailReason->new("$page is not a comment");
}
@@ -923,10 +925,10 @@ sub match_comment_pending ($$;@) {
my $page = shift;
my $glob = shift;
- if (! IkiWiki::isinternal($page)) {
- return IkiWiki::FailReason->new("$page is not a pending comment");
- }
- my $type=IkiWiki::pagetype($IkiWiki::pagesources{$page});
+ my $source=exists $IkiWiki::pagesources{$page} ?
+ $IkiWiki::pagesources{$page} :
+ $IkiWiki::delpagesources{$page};
+ my $type=IkiWiki::pagetype($source);
if (defined $type && $type ne "_comment_pending") {
return IkiWiki::FailReason->new("$page is not a pending comment");
}