Merge pull request #11570 from annando/issue-11470

Issue 11470: Check for removed account
This commit is contained in:
Hypolite Petovan 2022-05-28 18:32:21 -04:00 committed by GitHub
commit faa3f26d3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -65,7 +65,7 @@ function photos_init(App $a) {
if (DI::args()->getArgc() > 1) { if (DI::args()->getArgc() > 1) {
$owner = User::getOwnerDataByNick(DI::args()->getArgv()[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.')); throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
} }

View File

@ -220,7 +220,7 @@ class Profile
public static function load(App $a, string $nickname, bool $show_contacts = true) public static function load(App $a, string $nickname, bool $show_contacts = true)
{ {
$profile = User::getOwnerDataByNick($nickname); $profile = User::getOwnerDataByNick($nickname);
if (empty($profile)) { if (empty($profile) || $profile['account_removed']) {
Logger::info('profile error: ' . DI::args()->getQueryString()); Logger::info('profile error: ' . DI::args()->getQueryString());
return []; return [];
} }

View File

@ -49,7 +49,7 @@ class Profile extends BaseProfile
protected function rawContent(array $request = []) protected function rawContent(array $request = [])
{ {
if (ActivityPub::isRequest()) { 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)) { if (DBA::isResult($user)) {
try { try {
$data = ActivityPub\Transmitter::getProfile($user['uid']); $data = ActivityPub\Transmitter::getProfile($user['uid']);