]> git.mxchange.org Git - friendica.git/commitdiff
This is the correct way:
authorRoland Häder <roland@mxchange.org>
Tue, 19 Jul 2022 16:06:36 +0000 (18:06 +0200)
committerRoland Häder <roland@mxchange.org>
Tue, 19 Jul 2022 16:08:18 +0000 (18:08 +0200)
<?php
if (!isset($foo['account_removed) || $foo['account_removed'])
?>

mod/photos.php
src/Console/User.php
src/Model/Profile.php

index bd9762882ea96ea831e4ae4e4ce6756938a680b7..ed73f05ded8953144cedb5e59ca6d80ccb121fa3 100644 (file)
@@ -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.'));
                }
 
index 586c300eaf295518e796057b004c8c204c6b241d..25f5ceeb0781f6cfd354c2022d810e44b265e10b 100644 (file)
@@ -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);
 
index db79134fbd07e34aa71416ff531470ecc1739ddc..d27faaf5cd7d08fcfad4ae655f12a845277dcab1 100644 (file)
@@ -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 [];
                }