summaryrefslogtreecommitdiff
path: root/ext/dom/node.c
diff options
context:
space:
mode:
authorChristoph M. Becker <cmb@php.net>2015-09-05 01:32:08 +0200
committerChristoph M. Becker <cmb@php.net>2015-09-05 01:32:08 +0200
commitc9a8733ce2a953e46c07c380b15617d62f51dabd (patch)
tree3878419198e7f05c9e2ac1c486c92fff20a7a25c /ext/dom/node.c
parent320e891f5b39d26b422185803c809c995b43b7b2 (diff)
parentdc1a8dd7f09af5807aadf3ed5ffc9c443cd9e74c (diff)
downloadphp-git-c9a8733ce2a953e46c07c380b15617d62f51dabd.tar.gz
Merge branch 'PHP-5.6'
* PHP-5.6: Fix #70001: Assigning to DOMNode::textContent does additional entity encoding Resolved conflicts: ext/dom/node.c
Diffstat (limited to 'ext/dom/node.c')
-rw-r--r--ext/dom/node.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/dom/node.c b/ext/dom/node.c
index 2023073705..2f35e0110b 100644
--- a/ext/dom/node.c
+++ b/ext/dom/node.c
@@ -847,7 +847,6 @@ int dom_node_text_content_write(dom_object *obj, zval *newval)
{
xmlNode *nodep = dom_object_get_node(obj);
zend_string *str;
- xmlChar *enc_str;
if (nodep == NULL) {
php_dom_throw_error(INVALID_STATE_ERR, 0);
@@ -855,9 +854,9 @@ int dom_node_text_content_write(dom_object *obj, zval *newval)
}
str = zval_get_string(newval);
- enc_str = xmlEncodeEntitiesReentrant(nodep->doc, (xmlChar *) ZSTR_VAL(str));
- xmlNodeSetContent(nodep, enc_str);
- xmlFree(enc_str);
+ /* we have to use xmlNodeAddContent() to get the same behavior as with xmlNewText() */
+ xmlNodeSetContent(nodep, (xmlChar *) "");
+ xmlNodeAddContent(nodep, ZSTR_VAL(str));
zend_string_release(str);
return SUCCESS;