|
|
|
@ -264,9 +264,13 @@ class Readability implements LoggerAwareInterface |
|
|
|
$overlay->appendChild($innerDiv); |
|
|
|
$overlay->appendChild($innerDiv); |
|
|
|
|
|
|
|
|
|
|
|
// without tidy the body can (sometimes) be wiped, so re-create it |
|
|
|
// without tidy the body can (sometimes) be wiped, so re-create it |
|
|
|
|
|
|
|
try { |
|
|
|
if (!(property_exists($this->body, 'childNodes') && null !== $this->body->childNodes)) { |
|
|
|
if (!(property_exists($this->body, 'childNodes') && null !== $this->body->childNodes)) { |
|
|
|
$this->body = $this->dom->createElement('body'); |
|
|
|
$this->body = $this->dom->createElement('body'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} catch (\Exception $e) { |
|
|
|
|
|
|
|
$this->body = $this->dom->createElement('body'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Clear the old HTML, insert the new content. |
|
|
|
// Clear the old HTML, insert the new content. |
|
|
|
$this->body->setInnerHtml(''); |
|
|
|
$this->body->setInnerHtml(''); |
|
|
|
|