X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fbbcode.php;h=df883eed64aa79e100476252149edf4b50ad0011;hb=df7bdbfc66566a5063fa754fdcc83ec9230f9b6e;hp=fed535db573b8c52609b3d7c0a756703555653ce;hpb=511572533ed357a29bf49e24255282b02b5353ae;p=friendica.git diff --git a/include/bbcode.php b/include/bbcode.php index fed535db57..df883eed64 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -1,9 +1,13 @@ %s
', $data["url"], $data["title"]); + $return = sprintf('%s
', $data["url"], $data["title"]); } else { - if ($simplehtml != 4) { - $text = sprintf('', $data["type"]); - } - - $oembed = sprintf('[bookmark=%s]%s[/bookmark]', $data['url'], $data['title']); - if ($tryoembed) { - try { - $oembed = OEmbed::getHTML($data['url'], $data['title']); - } catch (Exception $e) { - // $oembed isn't modified + try { + if ($tryoembed && OEmbed::isAllowedURL($data['url'])) { + $return = OEmbed::getHTML($data['url'], $data['title']); + } else { + throw new Exception('OEmbed is disabled for this attachment.'); + } + } catch (Exception $e) { + if ($simplehtml != 4) { + $return = sprintf('
', $data["type"]); } - } - if (stripos($oembed, "