Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null documentElement handling #214

Open
bytestream opened this issue Nov 11, 2021 · 0 comments · May be fixed by #215
Open

Null documentElement handling #214

bytestream opened this issue Nov 11, 2021 · 0 comments · May be fixed by #215

Comments

@bytestream
Copy link

documentElement on the DOMDocument class can be either DocumentElement|null as noted at https://www.php.net/manual/en/class.domdocument.php

$document->removeChild($htmlElement);
doesn't correctly handle when documentElement returns NULL resulting in:

Argument 1 passed to DOMNode::removeChild() must be an instance of DOMNode, null given 

Given valid HTML input, this is noticeable in libxml 2.9.12 due to a bug in libxml https://gitlab.gnome.org/GNOME/libxml2/-/issues/318

@bytestream bytestream linked a pull request Nov 11, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant