From 9d87bc94a6270bc299eb5c411e38d43e25c417af Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 14 Sep 2019 07:12:25 +0000 Subject: [PATCH] Issue 6553: Restructured code for treating removed accounts --- src/Module/Profile.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Module/Profile.php b/src/Module/Profile.php index 9387276d0..0d14adcf9 100644 --- a/src/Module/Profile.php +++ b/src/Module/Profile.php @@ -57,21 +57,21 @@ class Profile extends BaseModule { if (ActivityPub::isRequest()) { $user = DBA::selectFirst('user', ['uid'], ['nickname' => self::$which]); - $data = []; if (DBA::isResult($user)) { $data = ActivityPub\Transmitter::getProfile($user['uid']); + if (!empty($data)) { + System::jsonExit($data, 'application/activity+json'); + } } - if (!empty($data)) { - System::jsonExit($data, 'application/activity+json'); - } elseif (DBA::exists('userd', ['username' => self::$which])) { + if (DBA::exists('userd', ['username' => self::$which])) { // Known deleted user $data = ActivityPub\Transmitter::getDeletedUser(self::$which); System::jsonError(410, $data); } else { // Any other case (unknown, blocked, unverified, expired, no profile, no self contact) - System::jsonError(404, $data); + System::jsonError(404, []); } } }