]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/smcvpostcomment.pm
smcvpostcomment: indicate in form whether HTML and directives are allowed
[git.ikiwiki.info.git] / IkiWiki / Plugin / smcvpostcomment.pm
index 43b1d3e6fbe8e927ac6bb0f642af59e094bdd5cb..2b9f1e5dcb390284df1d56e79a4d4671b78e6f0a 100644 (file)
@@ -171,7 +171,9 @@ sub sessioncgi ($$) { #{{{
        $form->tmpl_param('helponformattinglink',
                htmllink($page, $page, 'ikiwiki/formatting',
                        noimageinline => 1,
-                       linktext => 'FormattingHelp'));
+                       linktext => 'FormattingHelp'),
+                       allowhtml => $allow_html,
+                       allowdirectives => $allow_directives);
 
        if (not exists $pagesources{$page}) {
                error(sprintf(gettext(
@@ -205,6 +207,12 @@ sub sessioncgi ($$) { #{{{
                        unless $config{prefix_directives};
        }
 
+       unless ($allow_html) {
+               $body =~ s/&(\w|#)/&$1/g;
+               $body =~ s/</&lt;/g;
+               $body =~ s/>/&gt;/g;
+       }
+
        # In this template, the [[!meta]] directives should stay at the end,
        # so that they will override anything the user specifies. (For
        # instance, [[!meta author="I can fake the author"]]...)