Skip to content

Commit ad5ee8a

Browse files
committed
Revert changes to DOMAttr::$value and DOMAttr::$nodeValue expansion
Closes phpGH-11469.
1 parent 12e4628 commit ad5ee8a

File tree

5 files changed

+3
-63
lines changed

5 files changed

+3
-63
lines changed

Diff for: NEWS

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ PHP NEWS
1313
(nielsdos)
1414
. Fix #77894 (DOMNode::C14N() very slow on generated DOMDocuments even after
1515
normalisation). (nielsdos)
16+
. Revert changes to DOMAttr::$value and DOMAttr::$nodeValue expansion.
17+
(nielsdos)
1618

1719
- GD:
1820
. Removed imagerotate "ignore_transparent" argument since it has no effect.

Diff for: UPGRADING

-4
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ PHP 8.3 UPGRADE NOTES
4444
. Static variable initializers can now contain arbitrary expressions.
4545
RFC: https://wiki.php.net/rfc/arbitrary_static_variable_initializers
4646

47-
- DOM:
48-
. Assignment to DOMAttr::$value and DOMAttr::$nodeValue no longer expands
49-
entities in the new value.
50-
5147
- FFI:
5248
. C functions that have a return type of void now return null instead of
5349
returning the following object object(FFI\CData:void) { }

Diff for: ext/dom/attr.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,7 @@ int dom_attr_value_write(dom_object *obj, zval *newval)
148148
}
149149

150150
dom_remove_all_children((xmlNodePtr) attrp);
151-
xmlNodePtr node = xmlNewTextLen((xmlChar *) ZSTR_VAL(str), ZSTR_LEN(str));
152-
xmlAddChild((xmlNodePtr) attrp, node);
151+
xmlNodeSetContentLen((xmlNodePtr) attrp, (xmlChar *) ZSTR_VAL(str), ZSTR_LEN(str));
153152

154153
zend_string_release_ex(str, 0);
155154
return SUCCESS;

Diff for: ext/dom/node.c

-3
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,6 @@ int dom_node_node_value_write(dom_object *obj, zval *newval)
178178
/* Access to Element node is implemented as a convenience method */
179179
switch (nodep->type) {
180180
case XML_ATTRIBUTE_NODE:
181-
dom_remove_all_children(nodep);
182-
xmlAddChild(nodep, xmlNewTextLen((xmlChar *) ZSTR_VAL(str), ZSTR_LEN(str)));
183-
break;
184181
case XML_ELEMENT_NODE:
185182
dom_remove_all_children(nodep);
186183
ZEND_FALLTHROUGH;

Diff for: ext/dom/tests/DOMAttr_entity_expansion.phpt

-54
This file was deleted.

0 commit comments

Comments
 (0)