diff options
Diffstat (limited to 'IkiWiki/CGI.pm')
-rw-r--r-- | IkiWiki/CGI.pm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index b031aef56..54c526c2c 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -654,7 +654,12 @@ sub userlink ($) { #{{{ eval q{use Net::OpenID::VerifiedIdentity; 1} && !$@) { # Munge user-urls, as used by eg, OpenID. my $oid=Net::OpenID::VerifiedIdentity->new(identity => $user); - return "<a href=\"$user\">".escapeHTML($oid->display)."</a>"; + my $display=$oid->display; + # Convert "user.somehost.com" to "user [somehost.com]". + if ($display !~ /\[/) { + $display=~s/^(.*?)\.([^.]+.[^.]+)$/$1 [$2]/; + } + return "<a href=\"$user\">".escapeHTML($display)."</a>"; } else { return htmllink("", "", escapeHTML($user), 1); |