]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/comments.pm
git: don't redundantly pass "--" to git_sha1
[git.ikiwiki.info.git] / IkiWiki / Plugin / comments.pm
index e93db94ebc0f02d5e940d9092cd894fb9362c20e..46e1b268f1c2f503890ef17194728935112faef4 100644 (file)
@@ -126,7 +126,7 @@ sub htmlize {
 sub htmlize_pending {
        my %params = @_;
        return sprintf(gettext("this comment needs %s"),
-               '<a href="'.
+               '<a rel="nofollow" href="'.
                IkiWiki::cgiurl(do => "commentmoderation").'">'.
                gettext("moderation").'</a>');
 }
@@ -286,7 +286,7 @@ sub preprocess_moderation {
                unless defined $params{desc};
 
        if (length $config{cgiurl}) {
-               return '<a href="'.
+               return '<a rel="nofollow" href="'.
                        IkiWiki::cgiurl(do => 'commentmoderation').
                        '">'.$params{desc}.'</a>';
        }
@@ -356,7 +356,8 @@ sub editcomment ($$) {
        my @page_types;
        if (exists $IkiWiki::hooks{htmlize}) {
                foreach my $key (grep { !/^_/ && isallowed($_) } keys %{$IkiWiki::hooks{htmlize}}) {
-                       push @page_types, [$key, $IkiWiki::hooks{htmlize}{$key}{longname} || $key];
+                       push @page_types, [$key, $IkiWiki::hooks{htmlize}{$key}{longname} || $key]
+                               unless $IkiWiki::hooks{htmlize}{$key}{nocreate};
                }
        }
        @page_types=sort @page_types;
@@ -556,11 +557,12 @@ sub editcomment ($$) {
                }
                
                $postcomment=1;
-               my $ok=IkiWiki::check_content(content => $form->field('editcontent'),
-                       subject => $form->field('subject'),
+               my $ok=IkiWiki::check_content(
+                       content => scalar $form->field('editcontent'),
+                       subject => scalar $form->field('subject'),
                        $config{comments_allowauthor} ? (
-                               author => $form->field('author'),
-                               url => $form->field('url'),
+                               author => scalar $form->field('author'),
+                               url => scalar $form->field('url'),
                        ) : (),
                        page => $location,
                        cgi => $cgi,
@@ -600,7 +602,7 @@ sub editcomment ($$) {
                                length $form->field('subject')) {
                                $message = sprintf(
                                        gettext("Added a comment: %s"),
-                                       $form->field('subject'));
+                                       scalar $form->field('subject'));
                        }
 
                        IkiWiki::rcs_add($file);
@@ -944,7 +946,7 @@ sub pagetemplate (@) {
                                );
                        }
                        elsif (commentsopen($page)) {
-                               $link = "<a href=\"".addcommenturl($page)."\">".
+                               $link = "<a rel=\"nofollow\" href=\"".addcommenturl($page)."\">".
                                        #translators: Here "Comment" is a verb;
                                        #translators: the user clicks on it to
                                        #translators: post a comment.