]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/comments.pm
comments: don't interpolate IP into anonymous user's "name"
[ikiwiki.git] / IkiWiki / Plugin / comments.pm
index 6bd18a5cf2be10765a5dbbf5bf83fbd1a88c80bf..e43bbc49ed3ba0e3606bbb6acb1887ade226b261 100644 (file)
@@ -89,12 +89,10 @@ sub preprocess { # {{{
                ($commentauthorurl, $commentauthor) =
                        linkuser($params{username});
        }
-       elsif (defined $params{ip}) {
-               $commentip = $params{ip};
-               $commentauthor = sprintf(
-                       gettext("Anonymous (IP: %s)"), $params{ip});
-       }
        else {
+               if (defined $params{ip}) {
+                       $commentip = $params{ip};
+               }
                $commentauthor = gettext("Anonymous");
        }
 
@@ -302,7 +300,7 @@ sub sessioncgi ($$) { #{{{
 
        my $type = $form->param('type');
        if (defined $type && length $type && $IkiWiki::hooks{htmlize}{$type}) {
-               $type = possibly_foolish_untaint($type);
+               $type = IkiWiki::possibly_foolish_untaint($type);
        }
        else {
                $type = $config{default_pageext};
@@ -434,8 +432,10 @@ sub sessioncgi ($$) { #{{{
        }
 
        my $subject = $form->field('subject');
-       $subject =~ s/"/"/g;
-       $content .= " subject=\"$subject\"\n";
+       if (length $subject) {
+               $subject =~ s/"/"/g;
+               $content .= " subject=\"$subject\"\n";
+       }
 
        $content .= " date=\"" . IkiWiki::formattime(time, '%X %x') . "\"\n";