]> granicus.if.org Git - php/commitdiff
fix bug #51721 (mark DOMNodeList and DOMNamedNodeMap as Traversable)
authorRob Richards <rrichards@php.net>
Tue, 4 May 2010 12:55:26 +0000 (12:55 +0000)
committerRob Richards <rrichards@php.net>
Tue, 4 May 2010 12:55:26 +0000 (12:55 +0000)
NEWS
ext/dom/php_dom.c

diff --git a/NEWS b/NEWS
index b806e97ae1ceb36a47e6d60c58bfe7dee69e88a8..453bf7a5472f18cca4850bfb4f12f7e18334fa29 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -43,6 +43,8 @@ PHP                                                                        NEWS
   (Pierre)
 - Fixed bug #51723 (Content-length header is limited to 32bit integer with
   Apache2 on Windows). (Pierre)
+- Fixed bug #51721 (mark DOMNodeList and DOMNamedNodeMap as Traversable).
+  (David Zuelke)
 - Fixed bug #51690 (Phar::setStub looks for case-sensitive
   __HALT_COMPILER()). (Ilia)
 - Fixed bug #51688 (ini per dir crashes when invalid document root  are given).
index 76464c940b579530cb4cb70886dc9f1010559a49..b5db034642c1b8058fa45d77489459c39f224833 100644 (file)
@@ -29,6 +29,7 @@
 #include "ext/standard/php_rand.h"
 #include "php_dom.h"
 #include "dom_properties.h"
+#include "zend_interfaces.h"
 
 #include "ext/standard/info.h"
 #define PHP_XPATH 1
@@ -680,6 +681,7 @@ PHP_MINIT_FUNCTION(dom)
        ce.create_object = dom_nnodemap_objects_new;
        dom_nodelist_class_entry = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC);
        dom_nodelist_class_entry->get_iterator = php_dom_get_iterator;
+       zend_class_implements(dom_nodelist_class_entry TSRMLS_CC, 1, zend_ce_traversable);
 
        zend_hash_init(&dom_nodelist_prop_handlers, 0, NULL, NULL, 1);
        dom_register_prop_handler(&dom_nodelist_prop_handlers, "length", dom_nodelist_length_read, NULL TSRMLS_CC);
@@ -689,6 +691,7 @@ PHP_MINIT_FUNCTION(dom)
        ce.create_object = dom_nnodemap_objects_new;
        dom_namednodemap_class_entry = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC);
        dom_namednodemap_class_entry->get_iterator = php_dom_get_iterator;
+       zend_class_implements(dom_namednodemap_class_entry TSRMLS_CC, 1, zend_ce_traversable);
 
        zend_hash_init(&dom_namednodemap_prop_handlers, 0, NULL, NULL, 1);
        dom_register_prop_handler(&dom_namednodemap_prop_handlers, "length", dom_namednodemap_length_read, NULL TSRMLS_CC);