Tweak common_url_to_nickname to take the last path component; fixes pulling nicks from Google profile pages (path is "/profile/<nickname>")

This commit is contained in:
Brion Vibber 2010-02-25 23:52:34 +00:00
parent e254c660f6
commit 593885f98c

View File

@ -1698,7 +1698,8 @@ function common_url_to_nickname($url)
# Strip starting, ending slashes # Strip starting, ending slashes
$path = preg_replace('@/$@', '', $parts['path']); $path = preg_replace('@/$@', '', $parts['path']);
$path = preg_replace('@^/@', '', $path); $path = preg_replace('@^/@', '', $path);
if (strpos($path, '/') === false) { $path = basename($path);
if ($path) {
return common_nicknamize($path); return common_nicknamize($path);
} }
} }