]> git.mxchange.org Git - friendica.git/commitdiff
Fix warning
authorMichael <heluecht@pirati.ca>
Mon, 6 Mar 2023 06:43:04 +0000 (06:43 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 6 Mar 2023 06:43:04 +0000 (06:43 +0000)
src/Factory/Api/Mastodon/Card.php

index f6f6e3b67116e480c79fb02c16249d3e5903be09..c0bad9beb6ee9cea2b69dd418a3048dc467281bf 100644 (file)
@@ -40,7 +40,7 @@ class Card extends BaseFactory
        public function createFromUriId(int $uriId, array $history = []): \Friendica\Object\Api\Mastodon\Card
        {
                $media = Post\Media::getByURIId($uriId, [Post\Media::HTML]);
-               if (empty($media) && empty($media[0]['description']) && !empty($media[0]['image']) && !empty($media[0]['preview'])) {
+               if (empty($media) || (empty($media[0]['description']) && empty($media[0]['image']) && empty($media[0]['preview']))) {
                        return new \Friendica\Object\Api\Mastodon\Card([], $history);
                }