From cf8698afe683634a7d3b1b68ad335e73b41cba39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Tue, 19 Jul 2022 18:06:36 +0200 Subject: [PATCH] This is the correct way: --- mod/photos.php | 2 +- src/Console/User.php | 2 +- src/Model/Profile.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mod/photos.php b/mod/photos.php index bd9762882e..ed73f05ded 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 (empty($owner) || $owner['account_removed']) { + if (!isset($owner['account_removed']) || $owner['account_removed']) { throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.')); } diff --git a/src/Console/User.php b/src/Console/User.php index 586c300eaf..25f5ceeb07 100644 --- a/src/Console/User.php +++ b/src/Console/User.php @@ -310,7 +310,7 @@ HELP; * @return bool True, if the delete was successful * @throws \Exception */ - private function deleteUser() + private function deleteUser(): bool { $user = $this->getUserByNick(1); diff --git a/src/Model/Profile.php b/src/Model/Profile.php index db79134fbd..d27faaf5cd 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -221,7 +221,7 @@ class Profile public static function load(App $a, string $nickname, bool $show_contacts = true) { $profile = User::getOwnerDataByNick($nickname); - if (empty($profile) || !isset($profile['account_removed']) || $profile['account_removed']) { + if (!isset($profile['account_removed']) || $profile['account_removed']) { Logger::info('profile error: ' . DI::args()->getQueryString()); return []; }