]> git.mxchange.org Git - friendica.git/commitdiff
Refactor module Item Display
authorArt4 <art4@wlabs.de>
Mon, 18 Nov 2024 08:39:06 +0000 (08:39 +0000)
committerArt4 <art4@wlabs.de>
Mon, 18 Nov 2024 08:39:06 +0000 (08:39 +0000)
src/Module/Item/Display.php

index fbc977105b3e5efdef543c6057fbbbd96cdbcfc4..cca2dbf3a2a33b44e6492c16a4b7b0f0beaa37f0 100644 (file)
@@ -165,12 +165,13 @@ class Display extends BaseModule
         */
        protected function displaySidebar(array $item)
        {
+               $author = [];
                $shared = $this->contentItem->getSharedPost($item, ['author-link']);
-               if (!empty($shared) && empty($shared['comment'])) {
+               if (count($shared) > 0 && !array_key_exists('comment', $shared)) {
                        $author = Contact::getByURLForUser($shared['post']['author-link'], $this->session->getLocalUserId());
                }
 
-               if (empty($contact)) {
+               if ($author === []) {
                        $author = Contact::getById($item['author-id']);
                }