From 5feffc8b0b953856052c09dd431984e2e835b439 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 17 Dec 2008 19:06:29 -0500 Subject: fix test when comments_closed_pagespec is empty --- IkiWiki/Plugin/comments.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'IkiWiki/Plugin') 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; -- cgit v1.2.3