summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-02-23 21:11:44 +0000
committerBrion Vibber <brion@pobox.com>2010-02-23 21:11:44 +0000
commit5f9a8ca64bee5247358238c26b4f54003337d11b (patch)
tree602b620dac63cbb0309ac83f6b850a5a6f9d4cc8
parentb09304a6c4553044983176fb2740206777868378 (diff)
OStatus: accept webfinger addresses as well as profile URLs in the explicit remote subscribe form.
-rw-r--r--plugins/OStatus/actions/ostatussub.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/plugins/OStatus/actions/ostatussub.php b/plugins/OStatus/actions/ostatussub.php
index b3569e695..12832cdcf 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.');