summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2008-12-17 19:06:29 -0500
committerJoey Hess <joey@gnu.kitenet.net>2008-12-17 19:06:29 -0500
commit5feffc8b0b953856052c09dd431984e2e835b439 (patch)
tree071fa27470588f20a620e9a98acfced40daa9377
parent9f141841efc80dbe7a3ef8cc8fbae102c9cd190b (diff)
fix test when comments_closed_pagespec is empty
-rw-r--r--IkiWiki/Plugin/comments.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm
index 6e257d1d9..0b3007097 100644
--- a/IkiWiki/Plugin/comments.pm
+++ b/IkiWiki/Plugin/comments.pm
@@ -529,8 +529,13 @@ sub pagetemplate (@) {
$open = length $config{cgiurl} > 0;
}
- if (pagespec_match($page,
- "$config{comments_closed_pagespec} or */$config{comments_pagename}*",
+ if (pagespec_match($page, "*/$config{comments_pagename}*",
+ location => $page)) {
+ $shown = 0;
+ $open = 0;
+ }
+ if (length $config{comments_closed_pagespec} &&
+ pagespec_match($page, $config{comments_closed_pagespec},
location => $page)) {
$shown = 0;
$open = 0;