From: Mikael Nordfeldth Date: Wed, 19 Apr 2017 09:37:43 +0000 (+0200) Subject: Empty resource would throw exception X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2744bdcdb76e5d8affa7c54a583effadb7b1430d;p=quix0rs-gnu-social.git Empty resource would throw exception The "+ Remote" link on your profile page broke because of exception. --- diff --git a/plugins/OStatus/actions/ostatussub.php b/plugins/OStatus/actions/ostatussub.php index a8039ae565..7531bb6886 100644 --- a/plugins/OStatus/actions/ostatussub.php +++ b/plugins/OStatus/actions/ostatussub.php @@ -242,7 +242,11 @@ class OStatusSubAction extends Action function pullRemoteProfile() { $validate = new Validate(); - $this->profile_uri = Discovery::normalize($this->trimmed('profile')); + try { + $this->profile_uri = Discovery::normalize($this->trimmed('profile')); + } catch (Exception $e) { + $this->profile_uri = null; + } try { if (Discovery::isAcct($this->profile_uri) && $validate->email(mb_substr($this->profile_uri, 5))) { $this->oprofile = Ostatus_profile::ensureWebfinger($this->profile_uri);