]> granicus.if.org Git - php/commitdiff
Fixed Bug #70558 ("Couldn't fetch" error in DOMDocument::registerNodeClass())
authorXinchen Hui <laruence@gmail.com>
Wed, 23 Sep 2015 14:01:50 +0000 (07:01 -0700)
committerXinchen Hui <laruence@gmail.com>
Wed, 23 Sep 2015 14:01:50 +0000 (07:01 -0700)
NEWS
ext/dom/php_dom.c
ext/dom/tests/bug70558.phpt [new file with mode: 0644]

diff --git a/NEWS b/NEWS
index 8040507aba53141e3047c22422349295024c8748..9c2e74962c1a4055948295b3a78a344cd89a8fcb 100644 (file)
--- 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).
index 35900a58294706901a1d2d65e9107e6f7771f639..5510315bac9607b2a12e418e516be3b33b55b828 100644 (file)
@@ -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 (file)
index 0000000..c2d53d8
--- /dev/null
@@ -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)