]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Post/Share.php
Use the post language for the language detection / config for quality
[friendica.git] / src / Module / Post / Share.php
index 78ea1c63156ac6d239e81ae3bc9b817fc10fa0eb..0219eb99538feab10414a4b375df89e82f403602 100644 (file)
@@ -57,23 +57,23 @@ class Share extends \Friendica\BaseModule
        {
                $post_id = $this->parameters['post_id'];
                if (!$post_id || !$this->session->getLocalUserId()) {
-                       System::httpError(403);
+                       $this->httpError(403);
                }
 
                $item = Post::selectFirst(['private', 'body', 'uri', 'plink', 'network'], ['id' => $post_id]);
                if (!$item || $item['private'] == Item::PRIVATE) {
-                       System::httpError(404);
+                       $this->httpError(404);
                }
 
                $shared = $this->contentItem->getSharedPost($item, ['uri']);
                if ($shared && empty($shared['comment'])) {
                        $content = '[share]' . $shared['post']['uri'] . '[/share]';
-               } elseif ($item['network'] == Protocol::FEED) {
+               } elseif (!empty($item['plink']) && !in_array($item['network'], Protocol::FEDERATED)) {
                        $content = '[attachment]' . $item['plink'] . '[/attachment]';
                } else {
                        $content = '[share]' . $item['uri'] . '[/share]';
                }
 
-               System::httpExit($content);
+               $this->httpExit($content);
        }
 }