From: Roland Häder Date: Tue, 19 Jul 2022 16:06:36 +0000 (+0200) Subject: This is the correct way: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=cf8698afe683634a7d3b1b68ad335e73b41cba39;p=friendica.git This is the correct way: --- 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 []; }