mirror of
https://github.com/php/php-src.git
synced 2024-12-12 03:15:29 +08:00
allow the root element to be accessed as a text node
This commit is contained in:
parent
1aa6e3fee3
commit
a4f41fbb26
@ -738,12 +738,18 @@ sxe_object_cast(zval *readobj, zval *writeobj, int type, int should_free TSRMLS_
|
||||
zval_dtor(writeobj);
|
||||
}
|
||||
|
||||
if (!sxe->node) {
|
||||
if (sxe->document) {
|
||||
sxe->node = xmlDocGetRootElement((xmlDocPtr) sxe->document->ptr);
|
||||
}
|
||||
}
|
||||
|
||||
if (sxe->node) {
|
||||
contents = xmlNodeListGetString((xmlDocPtr) sxe->document->ptr, sxe->node->children, 1);
|
||||
if (!xmlIsBlankNode(sxe->node->children) && contents) {
|
||||
cast_object(writeobj, type, NULL TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cast_object(writeobj, type, contents TSRMLS_CC);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user