Skip to content

Commit

Permalink
Revert changes to DOMAttr::$value and DOMAttr::$nodeValue expansion
Browse files Browse the repository at this point in the history
Closes GH-11469.
  • Loading branch information
nielsdos committed Jun 19, 2023
1 parent 12e4628 commit ad5ee8a
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 63 deletions.
2 changes: 2 additions & 0 deletions NEWS
Expand Up @@ -13,6 +13,8 @@ PHP NEWS
(nielsdos)
. Fix #77894 (DOMNode::C14N() very slow on generated DOMDocuments even after
normalisation). (nielsdos)
. Revert changes to DOMAttr::$value and DOMAttr::$nodeValue expansion.
(nielsdos)

- GD:
. Removed imagerotate "ignore_transparent" argument since it has no effect.
Expand Down
4 changes: 0 additions & 4 deletions UPGRADING
Expand Up @@ -44,10 +44,6 @@ PHP 8.3 UPGRADE NOTES
. Static variable initializers can now contain arbitrary expressions.
RFC: https://wiki.php.net/rfc/arbitrary_static_variable_initializers

- DOM:
. Assignment to DOMAttr::$value and DOMAttr::$nodeValue no longer expands
entities in the new value.

- FFI:
. C functions that have a return type of void now return null instead of
returning the following object object(FFI\CData:void) { }
Expand Down
3 changes: 1 addition & 2 deletions ext/dom/attr.c
Expand Up @@ -148,8 +148,7 @@ int dom_attr_value_write(dom_object *obj, zval *newval)
}

dom_remove_all_children((xmlNodePtr) attrp);
xmlNodePtr node = xmlNewTextLen((xmlChar *) ZSTR_VAL(str), ZSTR_LEN(str));
xmlAddChild((xmlNodePtr) attrp, node);
xmlNodeSetContentLen((xmlNodePtr) attrp, (xmlChar *) ZSTR_VAL(str), ZSTR_LEN(str));

zend_string_release_ex(str, 0);
return SUCCESS;
Expand Down
3 changes: 0 additions & 3 deletions ext/dom/node.c
Expand Up @@ -178,9 +178,6 @@ int dom_node_node_value_write(dom_object *obj, zval *newval)
/* Access to Element node is implemented as a convenience method */
switch (nodep->type) {
case XML_ATTRIBUTE_NODE:
dom_remove_all_children(nodep);
xmlAddChild(nodep, xmlNewTextLen((xmlChar *) ZSTR_VAL(str), ZSTR_LEN(str)));
break;
case XML_ELEMENT_NODE:
dom_remove_all_children(nodep);
ZEND_FALLTHROUGH;
Expand Down
54 changes: 0 additions & 54 deletions ext/dom/tests/DOMAttr_entity_expansion.phpt

This file was deleted.

0 comments on commit ad5ee8a

Please sign in to comment.