Fix PHP 8.1 tests

pull/72/head
Jeremy Benoist 4 years ago
parent 28f1b08fac
commit 7da3eed512
No known key found for this signature in database
GPG Key ID: BCA73962457ACC3C
  1. 6
      src/Readability.php

@ -264,7 +264,11 @@ class Readability implements LoggerAwareInterface
$overlay->appendChild($innerDiv);
// without tidy the body can (sometimes) be wiped, so re-create it
if (!(property_exists($this->body, 'childNodes') && null !== $this->body->childNodes)) {
try {
if (!(property_exists($this->body, 'childNodes') && null !== $this->body->childNodes)) {
$this->body = $this->dom->createElement('body');
}
} catch (\Exception $e) {
$this->body = $this->dom->createElement('body');
}

Loading…
Cancel
Save