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.
master
Joey Hess 2015-05-13 23:24:27 -04:00
parent 497513e737
commit 7a68c4a01c
1 changed files with 5 additions and 1 deletions

View File

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