mirror of
https://github.com/j0k3r/php-readability.git
synced 2026-09-27 06:26:17 +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
|
public function init(): bool
|
||||||
{
|
{
|
||||||
|
if (!isset($this->dom)) {
|
||||||
$this->loadHtml();
|
$this->loadHtml();
|
||||||
|
}
|
||||||
|
|
||||||
if (!isset($this->dom->documentElement)) {
|
if (!isset($this->dom->documentElement)) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user