Merge pull request #4211 from annando/develop

bookmark elements weren't always parsed correctly
pull/4212/head^2
Hypolite Petovan 5 years ago committed by GitHub
commit c4db9edbe1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      src/Content/OEmbed.php

@ -35,7 +35,7 @@ class OEmbed
public static function replaceCallback($matches)
{
$embedurl = $matches[1];
$j = self::fetchURL($embedurl);
$j = self::fetchURL($embedurl, !self::isAllowedURL($embedurl));
$s = self::formatObject($j);
return $s;
@ -161,7 +161,7 @@ class OEmbed
return $j;
}
public static function formatObject($j)
private static function formatObject($j)
{
$embedurl = $j->embedurl;
$jhtml = $j->html;
@ -195,9 +195,7 @@ class OEmbed
case "link":
break;
case "rich":
if (self::isAllowedURL($embedurl)) {
$ret .= proxy_parse_html($jhtml);
}
$ret .= proxy_parse_html($jhtml);
break;
}
@ -322,7 +320,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 = self::fetchURL($url);
$o = self::fetchURL($url, !self::isAllowedURL($url));
if (!is_object($o) || $o->type == 'error') {
throw new Exception('OEmbed failed for URL: ' . $url);

Loading…
Cancel
Save