From: Simon McVittie Date: Sun, 21 Dec 2008 16:35:02 +0000 (+0000) Subject: openid: in &openiduser, allow subdirectory-style providers to end with '/' X-Git-Tag: 2.71~6^2~1 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/801dc76bf0e066558cc6ea179073104fb6a67c92 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). --- 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'};