From df706484cdf2e7a066ff54ddeacc4175f27db964 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Mon, 21 Jan 2019 16:56:15 -0500 Subject: [PATCH] User DOMDocument object call instead of static in Content\OEmbed --- src/Content/OEmbed.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Content/OEmbed.php b/src/Content/OEmbed.php index 0093ba11af..7adff89086 100644 --- a/src/Content/OEmbed.php +++ b/src/Content/OEmbed.php @@ -86,7 +86,8 @@ class OEmbed $redirects = 0; $html_text = Network::fetchUrl($embedurl, false, $redirects, 15, 'text/*'); if ($html_text) { - $dom = @DOMDocument::loadHTML($html_text); + $dom = new DOMDocument(); + $dom->loadHTML($html_text); if ($dom) { $xpath = new DOMXPath($dom); $entries = $xpath->query("//link[@type='application/json+oembed']"); @@ -274,7 +275,8 @@ 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 = @DOMDocument::loadHTML($html_text); + $dom = new DOMDocument(); + $dom->loadHTML($html_text); if (!$dom) { return $text; }