diff options
author | James Walker <walkah@walkah.net> | 2010-03-13 18:35:00 -0500 |
---|---|---|
committer | James Walker <walkah@walkah.net> | 2010-03-13 18:35:00 -0500 |
commit | 85cf90cf0fb613bab38ce8e0142544a044fe0d1d (patch) | |
tree | 37cf2a7ed118ff261f41b3b0afe1e07e336175c5 /plugins/OStatus/actions/userxrd.php | |
parent | 99ca84e68ed8cce97caa605fad04110d420c41b3 (diff) |
Performing & allowing host-meta discovery by http url (in addition to webfinger acct)
Diffstat (limited to 'plugins/OStatus/actions/userxrd.php')
-rw-r--r-- | plugins/OStatus/actions/userxrd.php | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/plugins/OStatus/actions/userxrd.php b/plugins/OStatus/actions/userxrd.php index 414de9364..eb80a5ad4 100644 --- a/plugins/OStatus/actions/userxrd.php +++ b/plugins/OStatus/actions/userxrd.php @@ -32,12 +32,15 @@ class UserxrdAction extends XrdAction parent::prepare($args); $this->uri = $this->trimmed('uri'); - $acct = Discovery::normalize($this->uri); - - list($nick, $domain) = explode('@', substr(urldecode($acct), 5)); - $nick = common_canonical_nickname($nick); - - $this->user = User::staticGet('nickname', $nick); + $this->uri = Discovery::normalize($this->uri); + + if (Discovery::isWebfinger($this->uri)) { + list($nick, $domain) = explode('@', substr(urldecode($this->uri), 5)); + $nick = common_canonical_nickname($nick); + $this->user = User::staticGet('nickname', $nick); + } else { + $this->user = User::staticGet('uri', $this->uri); + } if (!$this->user) { $this->clientError(_('No such user.'), 404); return false; |