Open bytestream opened 3 years ago
documentElement on the DOMDocument class can be either DocumentElement|null as noted at https://www.php.net/manual/en/class.domdocument.php
documentElement
DOMDocument
DocumentElement|null
https://github.com/tijsverkoyen/CssToInlineStyles/blob/f4f37098456b0801ee1de84214bbc83078ae3c63/src/CssToInlineStyles.php#L137 doesn't correctly handle when documentElement returns NULL resulting in:
NULL
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
documentElement
on theDOMDocument
class can be eitherDocumentElement|null
as noted at https://www.php.net/manual/en/class.domdocument.phphttps://github.com/tijsverkoyen/CssToInlineStyles/blob/f4f37098456b0801ee1de84214bbc83078ae3c63/src/CssToInlineStyles.php#L137 doesn't correctly handle when
documentElement
returnsNULL
resulting in: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