comments: only try to insert commentuser etc. into templates if the page contained...
authorSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>
Sat, 10 Jan 2009 11:29:56 +0000 (11:29 +0000)
committerSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>
Sat, 10 Jan 2009 11:29:56 +0000 (11:29 +0000)
IkiWiki/Plugin/comments.pm

index 3a0465dbb833fd0485d133bb39ee3ebc1daebf46..89410bb7016a2cca64c4c85ff8b14aa58a90b067 100644 (file)
@@ -604,6 +604,12 @@ sub pagetemplate (@) {
                }
        }
 
+       # everything below this point is only relevant to the comments
+       # themselves
+       if (!exists $commentstate{$page}) {
+               return;
+       }
+
        if ($template->query(name => 'commentuser')) {
                $template->param(commentuser =>
                        $commentstate{$page}{commentuser});