]> git.mxchange.org Git - friendica.git/commitdiff
Apply suggestions from code review
authorMichael Vogel <icarus@dabo.de>
Sun, 25 Jul 2021 05:04:48 +0000 (07:04 +0200)
committerGitHub <noreply@github.com>
Sun, 25 Jul 2021 05:04:48 +0000 (07:04 +0200)
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
mod/display.php
mod/photos.php
src/Module/Delegation.php
src/Module/Magic.php

index 6b30391d652dc8082b5c1a1692685a309acb2b5b..c0e72837af11ff07c4f95ebb565899759835767c 100644 (file)
@@ -122,15 +122,16 @@ function display_fetchauthor($item)
        // Check for a repeated message
        $shared = Item::getShareArray($item);
        if (!empty($shared) && empty($shared['comment'])) {
-               $profiledata = [];
-               $profiledata['uid'] = -1;
-               $profiledata['id'] = -1;
-               $profiledata['nickname'] = '';
-               $profiledata['name'] = '';
-               $profiledata['picdate'] = '';
-               $profiledata['photo'] = '';
-               $profiledata['url'] = '';
-               $profiledata['network'] = '';
+               $profiledata = [
+                       'uid' => -1,
+                       'id' => -1,
+                       'nickname' => '',
+                       'name' => '',
+                       'picdate' => '',
+                       'photo' => '',
+                       'url' => '',
+                       'network' => '',
+               ];
 
                if (!empty($shared['author'])) {
                        $profiledata['name'] = $shared['author'];
index e4b0dcf4ede9f626ae0b778640cd3e1c45ff8c56..d55541680a218803628b7ec7930a88c3bd9a0a04 100644 (file)
@@ -1624,7 +1624,7 @@ function photos_content(App $a)
        $o .= Renderer::replaceMacros($tpl, [
                '$title' => DI::l10n()->t('Recent Photos'),
                '$can_post' => $can_post,
-               '$upload' => [DI::l10n()->t('Upload New Photos'), 'photos/'.$user['nickname'].'/upload'],
+               '$upload' => [DI::l10n()->t('Upload New Photos'), 'photos/' . $user['nickname'] . '/upload'],
                '$photos' => $photos,
                '$paginate' => $pager->renderFull($total),
        ]);
index 201f38990c4b6023e4995b897c87852681c0916c..e50fb7d5f3b128538b56b5521e2a0d2b2be2125c 100644 (file)
@@ -118,7 +118,7 @@ class Delegation extends BaseModule
                        throw new ForbiddenException(DI::l10n()->t('Permission denied.'));
                }
 
-               $identities = User::identities(DI::session()->get('submanage') ?: local_user());
+               $identities = User::identities(DI::session()->get('submanage', local_user()));
 
                //getting additinal information for each identity
                foreach ($identities as $key => $identity) {
index 5b4676dd561966b7d9fb28d5cbc10bf3a9d13c3d..cbd629fd3c0c6e9d5f3742888cb99dd4b2ae688b 100644 (file)
@@ -65,7 +65,7 @@ class Magic extends BaseModule
                $contact = DBA::selectFirst('contact', ['id', 'nurl', 'url'], ['id' => $cid]);
 
                // Redirect if the contact is already authenticated on this site.
-               if (!empty($a->getContactId()) && strpos($contact['nurl'], Strings::normaliseLink(DI::baseUrl()->get())) !== false) {
+               if ($a->getContactId() && strpos($contact['nurl'], Strings::normaliseLink(DI::baseUrl()->get())) !== false) {
                        if ($test) {
                                $ret['success'] = true;
                                $ret['message'] .= 'Local site - you are already authenticated.' . EOL;