X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FContent%2FOEmbed.php;h=7afdfac35c35361e230fcb3b235a0c54eb21a300;hb=ae2e8beaaca342a0d5ced45beb0fc6c1b4f8a4a4;hp=4304bc91a0681368de4bd39896d6efc5a955bf48;hpb=532403ad15537f95efa1526e26fc2b811068f012;p=friendica.git diff --git a/src/Content/OEmbed.php b/src/Content/OEmbed.php index 4304bc91a0..7afdfac35c 100644 --- a/src/Content/OEmbed.php +++ b/src/Content/OEmbed.php @@ -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 */