diff options
author | Zach Copley <zach@status.net> | 2010-02-25 16:07:32 -0800 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2010-02-25 16:07:32 -0800 |
commit | 82cac2be595953029e61f2e6f21122206b82314e (patch) | |
tree | 7412949e83096339d86bdb5e5f20e9229ff5c1c3 | |
parent | 7922edb5b6c4ad55a1b81fa16c93e5656b676b26 (diff) | |
parent | 45435a7c033d9c5acf0352bc44408667c5690198 (diff) |
Merge branch 'testing' of gitorious.org:statusnet/mainline into testing
* 'testing' of gitorious.org:statusnet/mainline:
OStatus: if no <link> available and no profileurl hint passed in, use object id if it's an HTTP(S) URL. Fixes profile link for Google accounts.
Tweak common_url_to_nickname to take the last path component; fixes pulling nicks from Google profile pages (path is "/profile/<nickname>")
Fix bug on subscribe/unsubscribe in profile lists. Bogus call to nonexisting profile->getProfile() was masked by DB_DataObject
-rw-r--r-- | actions/subscribe.php | 2 | ||||
-rw-r--r-- | lib/util.php | 3 | ||||
-rw-r--r-- | plugins/OStatus/classes/Ostatus_profile.php | 2 |
3 files changed, 5 insertions, 2 deletions
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'); 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); } } diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php index 7026d82f2..5c082e5c6 100644 --- a/plugins/OStatus/classes/Ostatus_profile.php +++ b/plugins/OStatus/classes/Ostatus_profile.php @@ -1161,6 +1161,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); |