diff --git a/include/oembed.php b/include/oembed.php index b178d2605..e3053f164 100644 --- a/include/oembed.php +++ b/include/oembed.php @@ -177,7 +177,8 @@ function oembed_fetch_url($embedurl){ logger('fetch failure: ' . $furl); if($html_text) { - $dom = DOMDocument::loadHTML($html_text); + $dom = new DOMDocument(); + @$dom->loadHTML($html_text); if ($dom) { $xpath = new DOMXPath($dom); $attr = "oembed"; @@ -424,7 +425,8 @@ function oembed_html2bbcode($text) { $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) { $xpath = new DOMXPath($dom); $attr = "oembed";