From 4ef7f422570cba0290c6984463f9c7f5a6f9caa4 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 28 May 2022 16:21:41 +0000 Subject: [PATCH] Issue 11470: Check for removed account --- mod/photos.php | 2 +- src/Model/Profile.php | 2 +- src/Module/Profile/Profile.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mod/photos.php b/mod/photos.php index 52d749bb46..1374b85432 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -65,7 +65,7 @@ function photos_init(App $a) { if (DI::args()->getArgc() > 1) { $owner = User::getOwnerDataByNick(DI::args()->getArgv()[1]); - if (!$owner) { + if (empty($owner) || $owner['account_removed']) { throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.')); } diff --git a/src/Model/Profile.php b/src/Model/Profile.php index 5fbfc4ba5a..46c5b54242 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -220,7 +220,7 @@ class Profile public static function load(App $a, string $nickname, bool $show_contacts = true) { $profile = User::getOwnerDataByNick($nickname); - if (empty($profile)) { + if (empty($profile) || $profile['account_removed']) { Logger::info('profile error: ' . DI::args()->getQueryString()); return []; } diff --git a/src/Module/Profile/Profile.php b/src/Module/Profile/Profile.php index 199b96e2c9..ccc3208b60 100644 --- a/src/Module/Profile/Profile.php +++ b/src/Module/Profile/Profile.php @@ -49,7 +49,7 @@ class Profile extends BaseProfile protected function rawContent(array $request = []) { if (ActivityPub::isRequest()) { - $user = DBA::selectFirst('user', ['uid'], ['nickname' => $this->parameters['nickname']]); + $user = DBA::selectFirst('user', ['uid'], ['nickname' => $this->parameters['nickname'], 'account_removed' => false]); if (DBA::isResult($user)) { try { $data = ActivityPub\Transmitter::getProfile($user['uid']);