mirror of
https://github.com/php/php-src.git
synced 2024-12-12 03:15:29 +08:00
parent
320a41603e
commit
4938221a36
@ -1488,9 +1488,13 @@ SXE_METHOD(getName)
|
||||
sxe = php_sxe_fetch_object(getThis() TSRMLS_CC);
|
||||
|
||||
GET_NODE(sxe, node);
|
||||
|
||||
namelen = xmlStrlen(node->name);
|
||||
RETURN_STRINGL((char*)node->name, namelen, 1);
|
||||
node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
|
||||
if (node) {
|
||||
namelen = xmlStrlen(node->name);
|
||||
RETURN_STRINGL((char*)node->name, namelen, 1);
|
||||
} else {
|
||||
RETURN_EMPTY_STRING();
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
14
ext/simplexml/tests/bug41867.phpt
Normal file
14
ext/simplexml/tests/bug41867.phpt
Normal file
@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Bug #41867 (getName is broken)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = simplexml_load_string("<a><b><c/></b></a>");
|
||||
echo $a->getName()."\n";
|
||||
echo $a->b->getName()."\n";
|
||||
echo $a->b->c->getName();
|
||||
?>
|
||||
--EXPECT--
|
||||
a
|
||||
b
|
||||
c
|
Loading…
Reference in New Issue
Block a user