From: Michael Date: Thu, 11 Jan 2018 21:31:44 +0000 (+0000) Subject: When no OEmbedding is wanted, the links are now created fine again X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a7b2db5db9e4cc244ed14a22c4640432e02fbd06;p=friendica.git When no OEmbedding is wanted, the links are now created fine again --- diff --git a/include/bbcode.php b/include/bbcode.php index 08bfab3ed7..d389f302b7 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -75,7 +75,7 @@ function bb_attachment($return, $simplehtml = false, $tryoembed = true) $return = sprintf('%s
', $data["url"], $data["title"]); } else { try { - if ($tryoembed) { + if ($tryoembed && OEmbed::isAllowedURL($data['url'])) { $return = OEmbed::getHTML($data['url'], $data['title']); } else { throw new Exception('OEmbed is disabled for this attachment.'); @@ -94,7 +94,7 @@ function bb_attachment($return, $simplehtml = false, $tryoembed = true) if (($data["type"] == "photo") && ($data["url"] != "") && ($data["image"] != "")) { $return .= sprintf('', $data["url"], proxy_url($data["image"]), $data["title"]); } else { - $return .= sprintf('[bookmark=%s]%s[/bookmark]', $data['url'], $data['title']); + $return .= sprintf('

%s

', $data['url'], $data['title']); } if (trim($data["description"]) != "") { diff --git a/src/Content/OEmbed.php b/src/Content/OEmbed.php index 1b21dbf036..ff02563457 100644 --- a/src/Content/OEmbed.php +++ b/src/Content/OEmbed.php @@ -322,7 +322,7 @@ class OEmbed $url = str_replace(array("http://www.youtube.com/", "http://player.vimeo.com/"), array("https://www.youtube.com/", "https://player.vimeo.com/"), $url); - $o = OEmbed::fetchURL($url); + $o = self::fetchURL($url); if (!is_object($o) || $o->type == 'error') { throw new Exception('OEmbed failed for URL: ' . $url); @@ -332,7 +332,7 @@ class OEmbed $o->title = $title; } - $html = OEmbed::formatObject($o); + $html = self::formatObject($o); return $html; }