mirror of
https://github.com/php/php-src.git
synced 2025-08-19 08:49:28 +02:00
- Fix issue with entities in attributes
This commit is contained in:
parent
d78da85370
commit
f7459bad30
2 changed files with 10 additions and 5 deletions
|
@ -701,7 +701,14 @@ sxe_properties_get(zval *object TSRMLS_DC)
|
||||||
node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
|
node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
|
||||||
|
|
||||||
if (node) {
|
if (node) {
|
||||||
node = node->children;
|
if (node->type == XML_ATTRIBUTE_NODE) {
|
||||||
|
MAKE_STD_ZVAL(value);
|
||||||
|
ZVAL_U_STRING(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), value, xmlNodeListGetString(node->doc, node->children, 1), 1);
|
||||||
|
zend_hash_next_index_insert(rv, &value, sizeof(zval *), NULL);
|
||||||
|
node = NULL;
|
||||||
|
} else {
|
||||||
|
node = node->children;
|
||||||
|
}
|
||||||
|
|
||||||
while (node) {
|
while (node) {
|
||||||
if (node->children != NULL || node->prev != NULL || node->next != NULL) {
|
if (node->children != NULL || node->prev != NULL || node->next != NULL) {
|
||||||
|
|
|
@ -22,11 +22,9 @@ var_dump($sxe['attr']);
|
||||||
?>
|
?>
|
||||||
===DONE===
|
===DONE===
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
object(SimpleXMLElement)#1 (1) {
|
object(SimpleXMLElement)#%d (0) {
|
||||||
["attr"]=>
|
|
||||||
string(%d) "foo%sbar%sbaz"
|
|
||||||
}
|
}
|
||||||
object(SimpleXMLElement)#2 (1) {
|
object(SimpleXMLElement)#%d (1) {
|
||||||
[0]=>
|
[0]=>
|
||||||
string(%d) "foo%sbar%sbaz"
|
string(%d) "foo%sbar%sbaz"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue