com php-src: Fixed Bug #70558 ("Couldn't fetch" error in DOMDocument::registerNodeClass()): NEWS ext/dom/php_dom.c ext/dom/tests/bug70558.phpt

From: Date: Wed, 23 Sep 2015 14:01:50 +0000
Subject: com php-src: Fixed Bug #70558 ("Couldn't fetch" error in DOMDocument::registerNodeClass()): NEWS ext/dom/php_dom.c ext/dom/tests/bug70558.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-89135@lists.php.net to get a copy of this message
Commit: c87ef023aa404d310582e7a4c8c69c518a52f382 Author: Xinchen Hui <laruence@gmail.com> Wed, 23 Sep 2015 07:01:50 -0700 Parents: 1a5d6acff63c75b1fb933d4a7b32d073722cb6c5 Branches: PHP-7.0 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c87ef023aa404d310582e7a4c8c69c518a52f382 Log: Fixed Bug #70558 ("Couldn't fetch" error in DOMDocument::registerNodeClass()) Bugs: https://bugs.php.net/70558 Changed paths: M NEWS M ext/dom/php_dom.c A ext/dom/tests/bug70558.phpt Diff: diff --git a/NEWS b/NEWS index 8040507..9c2e749 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 35900a5..5510315 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 0000000..c2d53d8 --- /dev/null +++ b/ext/dom/tests/bug70558.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #70558 ("Couldn't fetch" error in DOMDocument::registerNodeClass()) +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--FILE-- +<?php + +class X extends \DOMDocument { + + public function __clone() { + var_dump($this->registerNodeClass('DOMDocument', 'X')); + } +} + +$dom = clone (new X()); +?> +--EXPECT-- +bool(true)

« previous php.cvs (#89135) next »