From: Joey Hess Date: Thu, 18 Dec 2008 00:06:29 +0000 (-0500) Subject: fix test when comments_closed_pagespec is empty X-Git-Tag: 2.71~70 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5feffc8b0b953856052c09dd431984e2e835b439;p=ikiwiki.git fix test when comments_closed_pagespec is empty --- 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;