openid: in &openiduser, let domain-style providers have arbitrarily many subdomains
This leads to better display for OpenIDs like smcv.pseudorandom.co.uk and thm.id.fedoraproject.org (to take a couple of examples from the IkiWiki commit history).master
parent
7bdeee2032
commit
e0cd19f30b
|
@ -191,9 +191,10 @@ sub openiduser ($) {
|
||||||
eval q{use Net::OpenID::VerifiedIdentity; 1} && !$@) {
|
eval q{use Net::OpenID::VerifiedIdentity; 1} && !$@) {
|
||||||
my $oid=Net::OpenID::VerifiedIdentity->new(identity => $user);
|
my $oid=Net::OpenID::VerifiedIdentity->new(identity => $user);
|
||||||
my $display=$oid->display;
|
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 !~ /\[/) {
|
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]".
|
# Convert "http://somehost.com/user" to "user [somehost.com]".
|
||||||
if ($display !~ /\[/) {
|
if ($display !~ /\[/) {
|
||||||
|
|
Loading…
Reference in New Issue