diff options
author | Aaron Piotrowski <aaron@trowski.com> | 2016-06-10 22:02:23 -0500 |
---|---|---|
committer | Aaron Piotrowski <aaron@trowski.com> | 2016-06-10 22:02:23 -0500 |
commit | e3c681aa5cc71122a8d2fae42e6513fc413ccac8 (patch) | |
tree | 5f1df62f7b666028edb0ee1adf083a52d63df45a /ext/dom/node.c | |
parent | fb4e3085cbaa76eb8f28eebf848a81d1c0190067 (diff) | |
parent | 792e89385ca6fc722a03590722eb7745a2374720 (diff) | |
download | php-git-e3c681aa5cc71122a8d2fae42e6513fc413ccac8.tar.gz |
Merge branch 'master' into throw-error-in-extensions
Diffstat (limited to 'ext/dom/node.c')
-rw-r--r-- | ext/dom/node.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/ext/dom/node.c b/ext/dom/node.c index 2023073705..4579b547d5 100644 --- a/ext/dom/node.c +++ b/ext/dom/node.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2015 The PHP Group | + | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -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; @@ -1349,9 +1348,9 @@ PHP_FUNCTION(dom_node_clone_node) xmlNode *n, *node; int ret; dom_object *intern; - zend_long recursive = 0; + zend_bool recursive = 0; - if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|l", &id, dom_node_class_entry, &recursive) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|b", &id, dom_node_class_entry, &recursive) == FAILURE) { return; } |