From 801dc76bf0e066558cc6ea179073104fb6a67c92 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sun, 21 Dec 2008 16:35:02 +0000 Subject: 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). --- IkiWiki/Plugin/openid.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'IkiWiki/Plugin/openid.pm') 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'}; -- cgit v1.2.3