]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
openid: in &openiduser, allow subdirectory-style providers to end with '/'
authorSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>
Sun, 21 Dec 2008 16:35:02 +0000 (16:35 +0000)
committerSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>
Sun, 21 Dec 2008 16:36:22 +0000 (16:36 +0000)
This improves the display of OpenIDs like 'http://id.mayfirst.org/jamie/'
(taking an example from the IkiWiki commit log).

IkiWiki/Plugin/openid.pm

index 4acfecf5efe44a9d82b2042de03b51b06263f9ad..574c42f0ed83efd2e4e4690d2680a4cc1a92df56 100644 (file)
@@ -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'};