OStatus: accept webfinger addresses as well as profile URLs in the explicit remote subscribe form.
This commit is contained in:
parent
b09304a6c4
commit
5f9a8ca64b
|
@ -288,10 +288,15 @@ class OStatusSubAction extends Action
|
|||
}
|
||||
$this->profile_uri = $profile_uri;
|
||||
|
||||
// @fixme validate, normalize bla bla
|
||||
try {
|
||||
$oprofile = Ostatus_profile::ensureProfile($this->profile_uri);
|
||||
$this->oprofile = $oprofile;
|
||||
if (Validate::email($this->profile_uri)) {
|
||||
$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;
|
||||
} catch (FeedSubBadURLException $e) {
|
||||
$this->error = _m('Invalid URL or could not reach server.');
|
||||
|
|
Loading…
Reference in New Issue
Block a user