mirror of
https://github.com/php/php-src.git
synced 2024-11-23 18:04:36 +08:00
Revert changes to DOMAttr::$value and DOMAttr::$nodeValue expansion
Closes GH-11469.
This commit is contained in:
parent
12e4628815
commit
ad5ee8a2b7
2
NEWS
2
NEWS
@ -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.
|
||||
|
@ -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) { }
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -1,54 +0,0 @@
|
||||
--TEST--
|
||||
DOMAttr entity expansion
|
||||
--EXTENSIONS--
|
||||
dom
|
||||
--FILE--
|
||||
<?php
|
||||
$doc = new DOMDocument;
|
||||
$elt = $doc->createElement('elt');
|
||||
$doc->appendChild($elt);
|
||||
$elt->setAttribute('a','&');
|
||||
print $doc->saveXML($elt) . "\n";
|
||||
|
||||
$attr = $elt->getAttributeNode('a');
|
||||
$attr->value = '&';
|
||||
print "$attr->value\n";
|
||||
print $doc->saveXML($elt) . "\n";
|
||||
|
||||
$attr->removeChild($attr->firstChild);
|
||||
print $doc->saveXML($elt) . "\n";
|
||||
|
||||
$attr->nodeValue = '&';
|
||||
print "$attr->nodeValue\n";
|
||||
print $doc->saveXML($elt) . "\n";
|
||||
|
||||
$attr->nodeValue = '&';
|
||||
print "$attr->nodeValue\n";
|
||||
print $doc->saveXML($elt) . "\n";
|
||||
|
||||
$elt->removeAttributeNode($attr);
|
||||
$elt->setAttributeNS('http://www.w3.org/2000/svg', 'svg:id','&');
|
||||
print $doc->saveXML($elt) . "\n";
|
||||
|
||||
$attr = $elt->getAttributeNodeNS('http://www.w3.org/2000/svg', 'id');
|
||||
$attr->value = '<&';
|
||||
print "$attr->value\n";
|
||||
print $doc->saveXML($elt) . "\n";
|
||||
|
||||
$node = new DOMAttr('foo','bar');
|
||||
$node->nodeValue = 'xx1yy';
|
||||
print "$node->nodeValue\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
<elt a="&"/>
|
||||
&
|
||||
<elt a="&amp;"/>
|
||||
<elt a=""/>
|
||||
&
|
||||
<elt a="&"/>
|
||||
&
|
||||
<elt a="&amp;"/>
|
||||
<elt xmlns:svg="http://www.w3.org/2000/svg" svg:id="&amp;"/>
|
||||
<&
|
||||
<elt xmlns:svg="http://www.w3.org/2000/svg" svg:id="&lt;&amp;"/>
|
||||
xx1yy
|
Loading…
Reference in New Issue
Block a user