]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/CGI.pm
* Add a test suite for the mercurial backend, contributed by Emanuele Aina.
[git.ikiwiki.info.git] / IkiWiki / CGI.pm
index b031aef56d4b744242c10f690f8cd3684c4b121a..d29151ace59356bf2f548592f08f2d46da3ca83a 100644 (file)
@@ -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/^(.*?)\.([^.]+\.[a-z]+)$/$1 [$2]/;
+               }
+               return "<a href=\"$user\">".escapeHTML($display)."</a>";
        }
        else {
                return htmllink("", "", escapeHTML($user), 1);