mirror of
https://github.com/friendica/friendica
synced 2025-04-24 13:50:10 +00:00
Handle exception on "head" / missing class variable added
This commit is contained in:
parent
a74bb57298
commit
d1af85b27f
4 changed files with 19 additions and 5 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue