Handle exception on "head" / missing class variable added

This commit is contained in:
Michael 2023-04-11 02:11:39 +00:00
parent a74bb57298
commit d1af85b27f
4 changed files with 19 additions and 5 deletions

View 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);