]> 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 4304bc91a0681368de4bd39896d6efc5a955bf48..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);
@@ -447,7 +447,7 @@ class OEmbed
         * Generates an XPath query to select elements whose provided attribute contains
         * the provided value in a space-separated list.
         *
-        * @param string $attr Name of the attribute to seach
+        * @param string $attr Name of the attribute to search
         * @param string $value Value to search in a space-separated list
         * @return string
         */