aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/openid.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2008-12-21 13:13:28 -0500
committerJoey Hess <joey@gnu.kitenet.net>2008-12-21 13:13:28 -0500
commit79d2d44db2acc4aeaf60de17d86951e1d7259e1d (patch)
treebd6fdf9bf2623240ac971b384ab97bf8dff4dbb7 /IkiWiki/Plugin/openid.pm
parent041f8e3774dc129346622df26647e49d7aa85375 (diff)
parentf0c76aa51ca7a1dbfb8fcfa679baa114e563b895 (diff)
downloadikiwiki-79d2d44db2acc4aeaf60de17d86951e1d7259e1d.tar
ikiwiki-79d2d44db2acc4aeaf60de17d86951e1d7259e1d.tar.gz
Merge commit 'smcv/openid'
Diffstat (limited to 'IkiWiki/Plugin/openid.pm')
-rw-r--r--IkiWiki/Plugin/openid.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm
index 2933c9ed9..574c42f0e 100644
--- a/IkiWiki/Plugin/openid.pm
+++ b/IkiWiki/Plugin/openid.pm
@@ -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'};