diff options
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; |