From 8a33bcbed46eccd2860136ec2c7332c9cfa639f7 Mon Sep 17 00:00:00 2001 From: Andres Rey Date: Thu, 15 Jun 2017 17:54:39 +0100 Subject: Safecheck for really bad HTML --- src/HTMLParser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/HTMLParser.php b/src/HTMLParser.php index 6e77e3f..9aa9974 100644 --- a/src/HTMLParser.php +++ b/src/HTMLParser.php @@ -125,7 +125,7 @@ class HTMLParser $this->metadata['title'] = $this->getTitle(); // Checking for minimum HTML to work with. - if (!($root = $this->dom->getElementsByTagName('body')->item(0))) { + if (!($root = $this->dom->getElementsByTagName('body')->item(0)) || !$root->firstChild) { return false; } -- cgit v1.2.3