From b92e23273de474b238d6f403f430cdc87869ab85 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 7 Oct 2022 21:17:39 +0000 Subject: [PATCH] Only use http links --- mod/share.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mod/share.php b/mod/share.php index 8392cad8df..8f55781e52 100644 --- a/mod/share.php +++ b/mod/share.php @@ -27,6 +27,7 @@ use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Item; use Friendica\Model\Post; +use Friendica\Util\Network; function share_init(App $a) { $post_id = ((DI::args()->getArgc() > 1) ? intval(DI::args()->getArgv()[1]) : 0); @@ -46,7 +47,7 @@ function share_init(App $a) { if (strpos($item['body'], "[/share]") !== false) { $pos = strpos($item['body'], "[share"); $o = substr($item['body'], $pos); - } elseif (in_array($item['network'], Protocol::FEDERATED)) { + } elseif (Network::isValidHttpUrl($item['uri']) && in_array($item['network'], Protocol::FEDERATED)) { $o = "[share]" . $item['uri'] . "[/share]"; } else { $o = BBCode::getShareOpeningTag($item['author-name'], $item['author-link'], $item['author-avatar'], $item['plink'], $item['created'], $item['guid']);