]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/comments.pm
Create page.
[ikiwiki.git] / IkiWiki / Plugin / comments.pm
index d9183970d8b1525c34a69a68dcec57fa88eaf58e..8f475aa56f483b319965a8c132b7db88260e7e93 100644 (file)
@@ -365,7 +365,7 @@ sub editcomment ($$) {
 
        # The untaint is OK (as in editpage) because we're about to pass
        # it to file_pruned and wiki_file_regexp anyway.
-       my $page = $form->field('page')=~/$config{wiki_file_regexp}/;
+       my ($page) = $form->field('page')=~/$config{wiki_file_regexp}/;
        $page = IkiWiki::possibly_foolish_untaint($page);
        if (! defined $page || ! length $page ||
                IkiWiki::file_pruned($page)) {
@@ -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