]> git.mxchange.org Git - friendica.git/blobdiff - src/Content/OEmbed.php
Merge pull request #13238 from annando/issue-13221
[friendica.git] / src / Content / OEmbed.php
index c113110662351f44d2328807cca1920d0d682c9d..7afdfac35c35361e230fcb3b235a0c54eb21a300 100644 (file)
@@ -334,8 +334,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);
-                       if (!$dom) {
+                       $dom = new DOMDocument();
+                       if (!@$dom->loadHTML($html_text)) {
                                return $text;
                        }
                        $xpath = new DOMXPath($dom);