X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FContent%2FOEmbed.php;h=94e95e5f51d234e04b3be242159c4b68cc894158;hb=f2d4a5eb7d0b5c153f73c4cc4e7bcb63dce1bb06;hp=7adff8908682d26e189dec42198f870f0496a1c0;hpb=df706484cdf2e7a066ff54ddeacc4175f27db964;p=friendica.git diff --git a/src/Content/OEmbed.php b/src/Content/OEmbed.php index 7adff89086..94e95e5f51 100644 --- a/src/Content/OEmbed.php +++ b/src/Content/OEmbed.php @@ -83,11 +83,9 @@ class OEmbed if (!in_array($ext, $noexts)) { // try oembed autodiscovery - $redirects = 0; - $html_text = Network::fetchUrl($embedurl, false, $redirects, 15, 'text/*'); + $html_text = Network::fetchUrl($embedurl, false, 15, 'text/*'); if ($html_text) { - $dom = new DOMDocument(); - $dom->loadHTML($html_text); + $dom = @DOMDocument::loadHTML($html_text); if ($dom) { $xpath = new DOMXPath($dom); $entries = $xpath->query("//link[@type='application/json+oembed']"); @@ -182,7 +180,6 @@ class OEmbed $tw = $th * $tr; $tpl = Renderer::getMarkupTemplate('oembed_video.tpl'); $ret .= Renderer::replaceMacros($tpl, [ - '$baseurl' => System::baseUrl(), '$embedurl' => $oembed->embed_url, '$escapedhtml' => base64_encode($oembed->html), '$tw' => $tw, @@ -275,8 +272,7 @@ class OEmbed $html_text = mb_convert_encoding($text, 'HTML-ENTITIES', mb_detect_encoding($text)); // If it doesn't parse at all, just return the text. - $dom = new DOMDocument(); - $dom->loadHTML($html_text); + $dom = @DOMDocument::loadHTML($html_text); if (!$dom) { return $text; }