History log of /PHP-8.2/ext/dom/tests/gh10234.phpt (Results 1 – 1 of 1)
Revision Date Author Comments
# c473787a 06-Jan-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-10234: Setting DOMAttr::textContent results in an empty attribute value

We can't directly call xmlNodeSetContent, because it might encode the string
through xmlStringLenGetNodeLis

Fix GH-10234: Setting DOMAttr::textContent results in an empty attribute value

We can't directly call xmlNodeSetContent, because it might encode the string
through xmlStringLenGetNodeList for types
XML_DOCUMENT_FRAG_NODE, XML_ELEMENT_NODE, XML_ATTRIBUTE_NODE.
In these cases we need to use a text node to avoid the encoding.
For the other cases, we *can* rely on xmlNodeSetContent because it is either
a no-op, or handles the content without encoding and clears the properties
field if needed.

The test was taken from the issue report, for the test:
Co-authored-by: ThomasWeinert <thomas@weinert.info>

Closes GH-10245.

show more ...