]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Quick fix for creating OpenID accounts authenticating against a MediaWiki site; trim...
authorBrion Vibber <brion@pobox.com>
Wed, 19 May 2010 23:19:06 +0000 (16:19 -0700)
committerBrion Vibber <brion@pobox.com>
Wed, 19 May 2010 23:19:06 +0000 (16:19 -0700)
lib/util.php

index 597da22c09464b5e38da95a640a2eff4e2f2ca93..59d5132ec60d86873e8d80274a42f5e8b5563570 100644 (file)
@@ -1925,6 +1925,15 @@ function common_url_to_nickname($url)
             $path = preg_replace('@/$@', '', $parts['path']);
             $path = preg_replace('@^/@', '', $path);
             $path = basename($path);
+
+            // Hack for MediaWiki user pages, in the form:
+            // http://example.com/wiki/User:Myname
+            // ('User' may be localized.)
+            if (strpos($path, ':')) {
+                $parts = array_filter(explode(':', $path));
+                $path = $parts[count($parts) - 1];
+            }
+
             if ($path) {
                 return common_nicknamize($path);
             }