From e254c660f66e1a04ac18220c95ef47aa88117e3c Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 25 Feb 2010 15:22:23 -0800 Subject: Fix bug on subscribe/unsubscribe in profile lists. Bogus call to nonexisting profile->getProfile() was masked by DB_DataObject --- actions/subscribe.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/subscribe.php b/actions/subscribe.php index 3745311b6..b1243f393 100644 --- a/actions/subscribe.php +++ b/actions/subscribe.php @@ -145,7 +145,7 @@ class SubscribeAction extends Action $this->element('title', null, _('Subscribed')); $this->elementEnd('head'); $this->elementStart('body'); - $unsubscribe = new UnsubscribeForm($this, $this->other->getProfile()); + $unsubscribe = new UnsubscribeForm($this, $this->other); $unsubscribe->show(); $this->elementEnd('body'); $this->elementEnd('html'); -- cgit v1.2.3-54-g00ecf From 593885f98c206a3acffdb179feae544e05a50ef2 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 25 Feb 2010 23:52:34 +0000 Subject: Tweak common_url_to_nickname to take the last path component; fixes pulling nicks from Google profile pages (path is "/profile/") --- lib/util.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); } } -- cgit v1.2.3-54-g00ecf From 45435a7c033d9c5acf0352bc44408667c5690198 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 26 Feb 2010 00:01:22 +0000 Subject: OStatus: if no available and no profileurl hint passed in, use object id if it's an HTTP(S) URL. Fixes profile link for Google accounts. --- plugins/OStatus/classes/Ostatus_profile.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php index f23017077..86a3c9354 100644 --- a/plugins/OStatus/classes/Ostatus_profile.php +++ b/plugins/OStatus/classes/Ostatus_profile.php @@ -1160,6 +1160,8 @@ class Ostatus_profile extends Memcached_DataObject $profile->profileurl = $object->link; } else if (array_key_exists('profileurl', $hints)) { $profile->profileurl = $hints['profileurl']; + } else if (Validate::uri($object->id, array('allowed_schemes' => array('http', 'https')))) { + $profile->profileurl = $object->id; } $profile->bio = self::getActivityObjectBio($object, $hints); -- cgit v1.2.3-54-g00ecf