mirror of
https://github.com/j0k3r/php-readability.git
synced 2026-09-26 22:16:12 +00:00
Prevent Readability::init() from resetting DOM if already set
Letting init() resetting the DOM may lead to unexpected behaviors in libraries like Graby. Related to https://github.com/j0k3r/graby/pull/392 Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
This commit is contained in:
@@ -213,7 +213,9 @@ class Readability implements LoggerAwareInterface
|
||||
*/
|
||||
public function init(): bool
|
||||
{
|
||||
if (!isset($this->dom)) {
|
||||
$this->loadHtml();
|
||||
}
|
||||
|
||||
if (!isset($this->dom->documentElement)) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user