From 6e962a2d747bd8a8bbbdfc5b8eaeb689100c0b1c Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 2 Jan 2013 18:05:33 +0000 Subject: [PATCH] opendiscussion: don't allow editing discussionpage if discussion is disabled --- IkiWiki/Plugin/opendiscussion.pm | 2 +- .../opendiscussion_should_respect_the_discussion_option.mdwn | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/IkiWiki/Plugin/opendiscussion.pm b/IkiWiki/Plugin/opendiscussion.pm index 2805f60ef..808d3cd2b 100644 --- a/IkiWiki/Plugin/opendiscussion.pm +++ b/IkiWiki/Plugin/opendiscussion.pm @@ -25,7 +25,7 @@ sub canedit ($$) { my $cgi=shift; my $session=shift; - return "" if $page=~/(\/|^)\Q$config{discussionpage}\E$/i; + return "" if $config{discussion} && $page=~/(\/|^)\Q$config{discussionpage}\E$/i; return "" if pagespec_match($page, "postcomment(*)"); return undef; } diff --git a/doc/bugs/opendiscussion_should_respect_the_discussion_option.mdwn b/doc/bugs/opendiscussion_should_respect_the_discussion_option.mdwn index e4bc736e3..0b9ed08be 100644 --- a/doc/bugs/opendiscussion_should_respect_the_discussion_option.mdwn +++ b/doc/bugs/opendiscussion_should_respect_the_discussion_option.mdwn @@ -4,3 +4,5 @@ the `discussionpage` setting to be edited anonymously, even if (If it respected the `discussion` option, the combination of `opendiscussion` and `moderatedcomments` might be good for blogs.) + +[[done]] --[[smcv]] -- 2.26.2