]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/openid.pm
po: remove renamed pages special handling, not needed anymore
[git.ikiwiki.info.git] / IkiWiki / Plugin / openid.pm
index 2933c9ed99960dd8e5edece394f11a6b9b08f085..574c42f0ed83efd2e4e4690d2680a4cc1a92df56 100644 (file)
@@ -191,13 +191,15 @@ sub openiduser ($) {
            eval q{use Net::OpenID::VerifiedIdentity; 1} && !$@) {
                my $oid=Net::OpenID::VerifiedIdentity->new(identity => $user);
                my $display=$oid->display;
-               # Convert "user.somehost.com" to "user [somehost.com]".
+               # Convert "user.somehost.com" to "user [somehost.com]"
+               # (also "user.somehost.co.uk")
                if ($display !~ /\[/) {
-                       $display=~s/^(.*?)\.([^.]+\.[a-z]+)$/$1 [$2]/;
+                       $display=~s/^([-a-zA-Z0-9]+?)\.([-.a-zA-Z0-9]+\.[a-z]+)$/$1 [$2]/;
                }
                # Convert "http://somehost.com/user" to "user [somehost.com]".
+               # (also "https://somehost.com/user/")
                if ($display !~ /\[/) {
-                       $display=~s/^https?:\/\/(.+)\/([^\/]+)$/$2 [$1]/;
+                       $display=~s/^https?:\/\/(.+)\/([^\/]+)\/?$/$2 [$1]/;
                }
                $display=~s!^https?://!!; # make sure this is removed
                eval q{use CGI 'escapeHTML'};