]> git.mxchange.org Git - friendica.git/commitdiff
Symplified code
authorMichael <heluecht@pirati.ca>
Sun, 30 Oct 2022 10:02:12 +0000 (10:02 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 30 Oct 2022 10:02:12 +0000 (10:02 +0000)
src/Model/Item.php

index f95b22e27beb87e11c208d2fda6cdf06ea991a1e..d148bf2738b4be60d0eec490e45cff1f7f5fffae 100644 (file)
@@ -3690,13 +3690,12 @@ class Item
                }
 
                $shared_item = Post::selectFirst(['uri-id'], ['id' => $id]);
-               if (!DBA::isResult($shared_item)) {
-                       Logger::warning('Post does not exist.', ['id' => $id, 'url' => $url, 'uid' => $uid]);
-                       return 0;
-               } else {
+               if (!empty($shared_item['uri-id'])) {
                        Logger::debug('Fetched shared post', ['id' => $id, 'url' => $url, 'uid' => $uid]);
+                       return $shared_item['uri-id'];
                }
 
-               return $shared_item['uri-id'];
+               Logger::warning('Post does not exist although it was supposed to had been fetched.', ['id' => $id, 'url' => $url, 'uid' => $uid]);
+               return 0;
        }
 }