From 9bb9bf56684ad7ccbc644cdcdf8891055753f58b Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 4 Nov 2022 13:01:48 -0400 Subject: [PATCH] Remove mod/share.php file --- mod/share.php | 51 --------------------------------------------------- 1 file changed, 51 deletions(-) delete mode 100644 mod/share.php diff --git a/mod/share.php b/mod/share.php deleted file mode 100644 index f0a2170b5e..0000000000 --- a/mod/share.php +++ /dev/null @@ -1,51 +0,0 @@ -. - * - */ - -use Friendica\App; -use Friendica\Content\Text\BBCode; -use Friendica\Core\System; -use Friendica\Database\DBA; -use Friendica\DI; -use Friendica\Model\Item; -use Friendica\Model\Post; - -function share_init(App $a) { - $post_id = ((DI::args()->getArgc() > 1) ? intval(DI::args()->getArgv()[1]) : 0); - - if (!$post_id || !DI::userSession()->getLocalUserId()) { - System::exit(); - } - - $fields = ['private', 'body', 'uri']; - $item = Post::selectFirst($fields, ['id' => $post_id]); - - if (!DBA::isResult($item) || $item['private'] == Item::PRIVATE) { - System::exit(); - } - - $shared = DI::contentItem()->getSharedPost($item, ['uri']); - if (!empty($shared) && empty($shared['comment'])) { - $content = '[share]' . $shared['post']['uri'] . '[/share]'; - } else { - $content = '[share]' . $item['uri'] . '[/share]'; - } - System::httpExit($content); -}