php-src/ext/dom
Niels Dossche c473787abb 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.
2023-05-29 14:10:59 +02:00
..
tests Fix GH-10234: Setting DOMAttr::textContent results in an empty attribute value 2023-05-29 14:10:59 +02:00
attr.c Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
cdatasection.c Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
characterdata.c Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
comment.c Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
config.m4 [RFC] Implement new DOM Living Standard APIs in ext/dom 2020-02-28 16:13:39 +01:00
config.w32 [RFC] Implement new DOM Living Standard APIs in ext/dom 2020-02-28 16:13:39 +01:00
CREDITS
document.c Merge branch 'PHP-8.0' into PHP-8.1 2023-02-12 21:33:39 -07:00
documentfragment.c Fixed some spaces used instead of tabs 2021-06-29 11:30:26 +02:00
documenttype.c Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
dom_ce.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
dom_iterators.c Fixed some spaces used instead of tabs 2021-06-29 11:30:26 +02:00
dom_properties.h Make a few unuseful DOMEntity properties readonly (#7406) 2021-08-26 10:37:45 +02:00
domexception.c Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
domexception.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
domimplementation.c Merge branch 'PHP-8.0' into PHP-8.1 2021-11-14 23:29:59 -08:00
element.c Merge branch 'PHP-8.0' into PHP-8.1 2021-09-13 12:14:32 +02:00
entity.c Update property read handler comments for DOMEntity 2021-08-26 13:15:24 +02:00
entityreference.c Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
namednodemap.c DOMNamedNodeMap::count() cannot return false 2021-07-16 16:27:53 +02:00
node.c Fix GH-10234: Setting DOMAttr::textContent results in an empty attribute value 2023-05-29 14:10:59 +02:00
nodelist.c DOMNodeList::count() cannot return false 2021-07-16 16:22:52 +02:00
notation.c Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
parentnode.c Fix GH-11288 and GH-11289 and GH-11290 and GH-9142: DOMExceptions and segfaults with replaceWith 2023-05-25 23:04:19 +02:00
php_dom_arginfo.h Fix a few more classsynopsis generation issues 2021-09-22 23:09:43 +02:00
php_dom.c Make a few unuseful DOMEntity properties readonly (#7406) 2021-08-26 10:37:45 +02:00
php_dom.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_dom.stub.php Fix a few more classsynopsis generation issues 2021-09-22 23:09:43 +02:00
processinginstruction.c Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
text.c Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
xml_common.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
xpath.c Fixed some spaces used instead of tabs 2021-06-29 11:30:26 +02:00