X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FParseUrl.php;h=8353cdf6d6713a9cb2bff393b8fcc98f36d7fcf0;hb=10f8631cd9423629d5189ae71d82964e4db18892;hp=8e72c4fa78160762408a3885bbc101f617007abe;hpb=d666b6cb42a1b0d46e9fae914a803fbd5e10e2ab;p=friendica.git diff --git a/src/Module/ParseUrl.php b/src/Module/ParseUrl.php index 8e72c4fa78..8353cdf6d6 100644 --- a/src/Module/ParseUrl.php +++ b/src/Module/ParseUrl.php @@ -1,6 +1,6 @@ userSession = $userSession; + } + + protected function rawContent(array $request = []) { - if (!Session::isAuthenticated()) { + if (!$this->userSession->isAuthenticated()) { throw new \Friendica\Network\HTTPException\ForbiddenException(); } @@ -88,16 +102,14 @@ class ParseUrl extends BaseModule if ($format == 'json') { System::jsonExit($arr['text']); } else { - echo $arr['text']; - exit(); + System::httpExit($arr['text']); } } if ($format == 'json') { $siteinfo = Util\ParseUrl::getSiteinfoCached($url); - if (empty($siteinfo['title']) && empty($siteinfo['text']) && empty($siteinfo['image']) - && in_array($siteinfo['type'], ['image', 'video', 'audio'])) { + if (in_array($siteinfo['type'], ['image', 'video', 'audio'])) { switch ($siteinfo['type']) { case 'video': $content_type = 'video'; @@ -123,8 +135,7 @@ class ParseUrl extends BaseModule System::jsonExit($ret); } else { - echo BBCode::embedURL($url, empty($_GET['noAttachment']), $title, $description, $_GET['tags'] ?? ''); - exit(); + System::httpExit(BBCode::embedURL($url, empty($_GET['noAttachment']), $title, $description, $_GET['tags'] ?? '')); } } }