From 2744bdcdb76e5d8affa7c54a583effadb7b1430d Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Wed, 19 Apr 2017 11:37:43 +0200 Subject: [PATCH] Empty resource would throw exception The "+ Remote" link on your profile page broke because of exception. --- plugins/OStatus/actions/ostatussub.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); -- 2.39.5