]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
when an emailauth user posts a comment, use the username only, not the full email...
authorJoey Hess <joeyh@joeyh.name>
Thu, 14 May 2015 03:24:27 +0000 (23:24 -0400)
committerJoey Hess <joeyh@joeyh.name>
Thu, 14 May 2015 03:26:22 +0000 (23:26 -0400)
This makes the email not be displayed on the wiki, so spammers won't find
it there.

Note that the full email address is still put into the comment template.
The email is also used as the username of the git commit message
(when posting comments or page edits). May want to revisit this later.

IkiWiki/Plugin/comments.pm

index fb423e713ddd093d1995272e9ff3548d727effee..eaa924e517222656233ea7261d58b2f709c51f3b 100644 (file)
@@ -198,7 +198,6 @@ sub preprocess {
                $commentuser = $params{username};
 
                my $oiduser = eval { IkiWiki::openiduser($commentuser) };
-
                if (defined $oiduser) {
                        # looks like an OpenID
                        $commentauthorurl = $commentuser;
@@ -206,6 +205,11 @@ sub preprocess {
                        $commentopenid = $commentuser;
                }
                else {
+                       my $emailuser = IkiWiki::emailuser($commentuser);
+                       if (defined $emailuser) {
+                               $commentuser=$emailuser;
+                       }
+
                        if (length $config{cgiurl}) {
                                $commentauthorurl = IkiWiki::cgiurl(
                                        do => 'goto',