From 6dbaf34290aff3a0abb02682811d28ed253c756f Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 19 Dec 2019 11:02:50 +0000 Subject: [PATCH 1/2] Issue 7685: Just forward on remoteauth for non legacy-DFRN and other contacts --- include/api.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/api.php b/include/api.php index 8b5f3315b..55a5d6f6d 100644 --- a/include/api.php +++ b/include/api.php @@ -5098,8 +5098,7 @@ function api_friendica_remoteauth() // traditional DFRN $contact = DBA::selectFirst('contact', [], ['uid' => api_user(), 'nurl' => $c_url]); - - if (!DBA::isResult($contact) || ($contact['network'] !== Protocol::DFRN)) { + if (!DBA::isResult($contact)) { throw new BadRequestException("Unknown contact"); } @@ -5107,6 +5106,10 @@ function api_friendica_remoteauth() $dfrn_id = $contact['issued-id'] ?? $contact['dfrn-id']; + if (($contact['network'] !== Protocol::DFRN) || empty($dfrn_id)) { + System::externalRedirect($url ?? $c_url); + } + if ($contact['duplex'] && $contact['issued-id']) { $orig_id = $contact['issued-id']; $dfrn_id = '1:' . $orig_id; From 295ee82a61396bed233288df5c585ba392005475 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 19 Dec 2019 12:39:30 +0000 Subject: [PATCH 2/2] Changed "??" to "?:" --- include/api.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/api.php b/include/api.php index 55a5d6f6d..5c708c0b7 100644 --- a/include/api.php +++ b/include/api.php @@ -5104,10 +5104,10 @@ function api_friendica_remoteauth() $cid = $contact['id']; - $dfrn_id = $contact['issued-id'] ?? $contact['dfrn-id']; + $dfrn_id = $contact['issued-id'] ?: $contact['dfrn-id']; if (($contact['network'] !== Protocol::DFRN) || empty($dfrn_id)) { - System::externalRedirect($url ?? $c_url); + System::externalRedirect($url ?: $c_url); } if ($contact['duplex'] && $contact['issued-id']) {