X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fbbcode.php;h=20631818a2503fbe8167130edd644e1cccd6a41b;hb=28d79281a9d521591d197215aaf9a7c92ed265e1;hp=f20942dbad674b12ad4ba6456f98e14da9a427aa;hpb=d8a312d286eb64b16c0345723389bb15a2803553;p=friendica.git diff --git a/include/bbcode.php b/include/bbcode.php index f20942dbad..20631818a2 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -1,17 +1,22 @@ %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, "