From: Xinchen Hui Date: Wed, 23 Sep 2015 14:01:50 +0000 (-0700) Subject: Fixed Bug #70558 ("Couldn't fetch" error in DOMDocument::registerNodeClass()) X-Git-Tag: php-7.1.0alpha1~1112^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c87ef023aa404d310582e7a4c8c69c518a52f382;p=php Fixed Bug #70558 ("Couldn't fetch" error in DOMDocument::registerNodeClass()) --- diff --git a/NEWS b/NEWS index 8040507aba..9c2e74962c 100644 --- a/NEWS +++ b/NEWS @@ -3,26 +3,17 @@ PHP NEWS 01 Oct 2015, PHP 7.0.0 RC 4 - Core: - . Fixed bug #70557 (Memleak on return type verifying failed). (Laruence) - . Fixed bug #70555 (fun_get_arg() on unsetted vars return UNKNOW). (Laruence) - . Fixed bug #70548 (Redundant information printed in case of uncaught engine - exception). (Laruence) - . Fixed bug #70547 (unsetting function variables corrupts backtrace). - (Laruence) . Fixed bug #70528 (assert() with instanceof adds apostrophes around class name). (Laruence) . Fixed bug #70481 (Memory leak in auto_global_copy_ctor() in ZTS build). (Laruence) -- FPM: - . Fixed bug #70538 ("php-fpm -i" crashes). (rainer dot jung at - kippdata dot de) - . Fixed bug #70279 (HTTP Authorization Header is sometimes passed to newer - reqeusts). (Laruence) +- DOM: + . Fixed bug #70558 ("Couldn't fetch" error in + DOMDocument::registerNodeClass()). (Laruence) - OpenSSL . Require at least OpenSSL version 0.9.8. (Jakub Zelenka) - . Fixed bug #68312 (Lookup for openssl.cnf causes a message box). (Anatol) - Session: . Fixed bug #70529 (Session read causes "String is not zero-terminated" error). diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c index 35900a5829..5510315bac 100644 --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@ -507,7 +507,6 @@ static zend_object *dom_objects_store_clone_obj(zval *zobject) /* {{{ */ dom_object *clone = dom_objects_set_class(intern->std.ce, 0); clone->std.handlers = dom_get_obj_handlers(); - zend_objects_clone_members(&clone->std, &intern->std); if (instanceof_function(intern->std.ce, dom_node_class_entry)) { xmlNodePtr node = (xmlNodePtr)dom_object_get_node(intern); @@ -528,6 +527,8 @@ static zend_object *dom_objects_store_clone_obj(zval *zobject) /* {{{ */ } } + zend_objects_clone_members(&clone->std, &intern->std); + return &clone->std; } /* }}} */ diff --git a/ext/dom/tests/bug70558.phpt b/ext/dom/tests/bug70558.phpt new file mode 100644 index 0000000000..c2d53d893d --- /dev/null +++ b/ext/dom/tests/bug70558.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #70558 ("Couldn't fetch" error in DOMDocument::registerNodeClass()) +--SKIPIF-- + +--FILE-- +registerNodeClass('DOMDocument', 'X')); + } +} + +$dom = clone (new X()); +?> +--EXPECT-- +bool(true)