]> git.mxchange.org Git - friendica.git/commitdiff
User DOMDocument object call instead of static in Content\OEmbed
authorHypolite Petovan <hypolite@mrpetovan.com>
Mon, 21 Jan 2019 21:56:15 +0000 (16:56 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Wed, 23 Jan 2019 14:07:00 +0000 (09:07 -0500)
src/Content/OEmbed.php

index 0093ba11af38a8e948ab6cca40d5b0c59be0cf40..7adff8908682d26e189dec42198f870f0496a1c0 100644 (file)
@@ -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;
                        }