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
1 changed files with 2 additions and 1 deletions

View File

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