summaryrefslogtreecommitdiff
path: root/lib/util.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-02-25 23:52:34 +0000
committerBrion Vibber <brion@pobox.com>2010-02-25 23:52:34 +0000
commit593885f98c206a3acffdb179feae544e05a50ef2 (patch)
tree72d31323a1f45d0a468a4bbf37143f2c16e37d64 /lib/util.php
parente254c660f66e1a04ac18220c95ef47aa88117e3c (diff)
Tweak common_url_to_nickname to take the last path component; fixes pulling nicks from Google profile pages (path is "/profile/<nickname>")
Diffstat (limited to 'lib/util.php')
-rw-r--r--lib/util.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/util.php b/lib/util.php
index d1c78f7d0..8381bc63c 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -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);
}
}