Skip to content

Commit cd9fe16

Browse files
author
Joey Smith
committed
This should get xmldocfile() working again.
This should fix bugs: 11192, 10899
1 parent 88e45cf commit cd9fe16

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

ext/domxml/php_domxml.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2123,7 +2123,7 @@ PHP_FUNCTION(xmldoc)
21232123
Creates DOM object of XML document in file*/
21242124
PHP_FUNCTION(xmldocfile)
21252125
{
2126-
zval *arg;
2126+
zval *arg, *rv;
21272127
xmlDoc *docp;
21282128
int ret;
21292129

@@ -2138,8 +2138,11 @@ PHP_FUNCTION(xmldocfile)
21382138
}
21392139
ret = zend_list_insert(docp, le_domxmldocp);
21402140

2141-
/* construct an object with some methods */
2142-
object_init_ex(return_value, domxmldoc_class_entry);
2141+
rv = php_domobject_new((xmlNodePtr) docp, &ret);
2142+
SEPARATE_ZVAL(&rv);
2143+
*return_value = *rv;
2144+
FREE_ZVAL(rv);
2145+
21432146
add_property_resource(return_value, "doc", ret);
21442147
if(docp->name)
21452148
add_property_stringl(return_value, "name", (char *) docp->name, strlen(docp->name), 1);

0 commit comments

Comments
 (0)