]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/comments.pm
comment: Don't show comments of subpages on parent pages. (Fixes bug introduced in...
[git.ikiwiki.info.git] / IkiWiki / Plugin / comments.pm
index 29c9d4f40012b096dba442298f5addd2206d2252..06a2b1bd9bfe5a5a5815f88f983012294124924b 100644 (file)
@@ -959,7 +959,8 @@ sub match_comment ($$;@) {
                }
        }
 
-       return match_glob($page, "$glob/*", internal => 1, @_);
+       return match_glob($page, "$glob/*", internal => 1, @_) &&
+               ! match_glob($page, "$glob/*/*", internal => 1, @_);
 }
 
 sub match_comment_pending ($$;@) {
@@ -974,7 +975,8 @@ sub match_comment_pending ($$;@) {
                return IkiWiki::FailReason->new("$page is not a pending comment");
        }
 
-       return match_glob($page, "$glob/*", internal => 1, @_);
+       return match_glob($page, "$glob/*", internal => 1, @_) &&
+               ! match_glob($page, "$glob/*/*", internal => 1, @_);
 }
 
 1