From: Brion Vibber Date: Tue, 23 Feb 2010 21:11:44 +0000 (+0000) Subject: OStatus: accept webfinger addresses as well as profile URLs in the explicit remote... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5f9a8ca64bee5247358238c26b4f54003337d11b;p=quix0rs-gnu-social.git OStatus: accept webfinger addresses as well as profile URLs in the explicit remote subscribe form. --- diff --git a/plugins/OStatus/actions/ostatussub.php b/plugins/OStatus/actions/ostatussub.php index b3569e6951..12832cdcfb 100644 --- a/plugins/OStatus/actions/ostatussub.php +++ b/plugins/OStatus/actions/ostatussub.php @@ -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.');