From b34d31142b9fed28ec9cf77fe0c5d9f405d48c84 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 27 Feb 2011 18:16:07 -0400 Subject: comment: Don't show comments of subpages on parent pages. (Fixes bug introduced in version 3.20100505.) --- IkiWiki/Plugin/comments.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 6691dbafa..8f475aa56 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -957,7 +957,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 ($$;@) { @@ -972,7 +973,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 -- cgit v1.2.3