aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>2008-12-21 16:35:02 +0000
committerSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>2008-12-21 16:36:22 +0000
commit801dc76bf0e066558cc6ea179073104fb6a67c92 (patch)
treecf085d26cad27f54c96c21dc3ea81e8b29ace42a /IkiWiki
parente0cd19f30b5cc66450bdb52bd9840c6d8fa774eb (diff)
downloadikiwiki-801dc76bf0e066558cc6ea179073104fb6a67c92.tar
ikiwiki-801dc76bf0e066558cc6ea179073104fb6a67c92.tar.gz
openid: in &openiduser, allow subdirectory-style providers to end with '/'
This improves the display of OpenIDs like 'http://id.mayfirst.org/jamie/' (taking an example from the IkiWiki commit log).
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/openid.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm
index 4acfecf5e..574c42f0e 100644
--- a/IkiWiki/Plugin/openid.pm
+++ b/IkiWiki/Plugin/openid.pm
@@ -197,8 +197,9 @@ sub openiduser ($) {
$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'};