libxml2 2.9.12 breaks all PHP versions use of DOMDocument::saveHTML()
Previously, calling in PHP:
php -r 'var_dump((new DOMDocument)->saveHTML());'
Command line code:1:
string(1) "
"
saveHTML()
was returning an empty HTML string.
This was consistent across all versions of PHP: https://3v4l.org/W83pq
Now, on my Gentoo Linux that got updated to libxml2 2.9.12, the output is:
php -r 'var_dump((new DOMDocument)->saveHTML());'
Command line code:1:
bool(false)
and it breaks the API of libraries that tries to return a string type, not a boolean.
PHP' source code is using htmlNodeDumpFormatOutput
, you can see how libxml2 is used: https://github.com/php/php-src/blob/master/ext/dom/document.c#L1954-L2035
I opened an issue on Gentoo bug tracker (https://bugs.gentoo.org/794733) and have been suggested to create a bug here.