We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 5f9a8ca6 authored by Brion Vibber's avatar Brion Vibber

OStatus: accept webfinger addresses as well as profile URLs in the explicit remote subscribe form.

parent b09304a6
...@@ -288,10 +288,15 @@ class OStatusSubAction extends Action ...@@ -288,10 +288,15 @@ class OStatusSubAction extends Action
} }
$this->profile_uri = $profile_uri; $this->profile_uri = $profile_uri;
// @fixme validate, normalize bla bla
try { try {
$oprofile = Ostatus_profile::ensureProfile($this->profile_uri); if (Validate::email($this->profile_uri)) {
$this->oprofile = $oprofile; $this->oprofile = Ostatus_profile::ensureWebfinger($this->profile_uri);
} else if (Validate::uri($this->profile_uri)) {
$this->oprofile = Ostatus_profile::ensureProfile($this->profile_uri);
} else {
$this->error = _m("Invalid address format.");
return false;
}
return true; return true;
} catch (FeedSubBadURLException $e) { } catch (FeedSubBadURLException $e) {
$this->error = _m('Invalid URL or could not reach server.'); $this->error = _m('Invalid URL or could not reach server.');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment