X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/d4b44755215a40dd163753719e539bf84124587d..4a40b5f9d56e4a36112af0007f52357761a5b3fb:/IkiWiki/CGI.pm?ds=sidebyside diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index b031aef56..b90b43d8d 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -654,7 +654,13 @@ 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 "".escapeHTML($oid->display).""; + my $display=$oid->display; + # Convert "user.somehost.com" to "user [somehost.com]". + if ($display !~ /\[/) { + $display=~s/^(.*?)\.([^.]+\.[a-z]+)$/$1 [$2]/; + } + $display=~s!^https?://!!; # make sure this is removed + return "".escapeHTML($display).""; } else { return htmllink("", "", escapeHTML($user), 1);