diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-05-13 23:24:27 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-05-13 23:26:22 -0400 |
commit | 7a68c4a01c5f8c044b9326a2efc8293cb8825cb6 (patch) | |
tree | 5f8d15539b01e7311a4bdb6c4ad108f2a3938ea6 | |
parent | 497513e737a92d2115f5d2a16610561b8a1dffdc (diff) | |
download | ikiwiki-7a68c4a01c5f8c044b9326a2efc8293cb8825cb6.tar ikiwiki-7a68c4a01c5f8c044b9326a2efc8293cb8825cb6.tar.gz |
when an emailauth user posts a comment, use the username only, not the full email address
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.
-rw-r--r-- | IkiWiki/Plugin/comments.pm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index fb423e713..eaa924e51 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -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', |