Empty resource would throw exception

The "+ Remote" link on your profile page broke because of exception.
This commit is contained in:
Mikael Nordfeldth 2017-04-19 11:37:43 +02:00
parent 2a8ab1c6ca
commit 548e59fc99
1 changed files with 5 additions and 1 deletions

View File

@ -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);