summaryrefslogtreecommitdiff
path: root/ext/dom/attr.c
diff options
context:
space:
mode:
authorTjerk Meesters <datibbaw@php.net>2014-09-02 06:34:18 +0800
committerTjerk Meesters <datibbaw@php.net>2014-09-02 06:34:18 +0800
commitf54451cf399ebba0e52b42ab45de52f0f4bc3afb (patch)
treef6b03bf141b7237063356193a9497fad2b34ff78 /ext/dom/attr.c
parent8da58e36b4facf3cccb14183303ded36eff95e71 (diff)
downloadphp-git-f54451cf399ebba0e52b42ab45de52f0f4bc3afb.tar.gz
Make DOMNode::textContent writeable
Diffstat (limited to 'ext/dom/attr.c')
-rw-r--r--ext/dom/attr.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/ext/dom/attr.c b/ext/dom/attr.c
index ebbc41f6f5..2976add461 100644
--- a/ext/dom/attr.c
+++ b/ext/dom/attr.c
@@ -183,14 +183,7 @@ int dom_attr_value_write(dom_object *obj, zval *newval TSRMLS_DC)
node_list_unlink(attrp->children TSRMLS_CC);
}
- if (newval->type != IS_STRING) {
- if(Z_REFCOUNT_P(newval) > 1) {
- value_copy = *newval;
- zval_copy_ctor(&value_copy);
- newval = &value_copy;
- }
- convert_to_string(newval);
- }
+ convert_to_string_copy(newval, value_copy);
xmlNodeSetContentLen((xmlNodePtr) attrp, Z_STRVAL_P(newval), Z_STRLEN_P(newval) + 1);