diff options
Diffstat (limited to 'ext/dom')
| -rw-r--r-- | ext/dom/config.m4 | 4 | ||||
| -rw-r--r-- | ext/dom/php_dom.c | 17 | ||||
| -rw-r--r-- | ext/dom/tests/bug28721.phpt | 2 | ||||
| -rw-r--r-- | ext/dom/tests/bug28817.phpt | 2 | ||||
| -rw-r--r-- | ext/dom/tests/bug32615.phpt | 2 | ||||
| -rw-r--r-- | ext/dom/tests/bug34276.phpt | 2 | ||||
| -rw-r--r-- | ext/dom/tests/bug35342.phpt | 5 | ||||
| -rw-r--r-- | ext/dom/tests/bug37277.phpt | 2 | ||||
| -rw-r--r-- | ext/dom/tests/bug37456.phpt | 2 | ||||
| -rw-r--r-- | ext/dom/tests/bug38850.phpt | 2 | ||||
| -rw-r--r-- | ext/dom/tests/bug38949.phpt | 2 | ||||
| -rw-r--r-- | ext/dom/tests/bug40836.phpt | 2 | ||||
| -rw-r--r-- | ext/dom/tests/bug41257.phpt | 2 | ||||
| -rw-r--r-- | ext/dom/tests/bug41374.phpt | 2 | ||||
| -rw-r--r-- | ext/dom/tests/bug42082.phpt | 27 |
15 files changed, 59 insertions, 16 deletions
diff --git a/ext/dom/config.m4 b/ext/dom/config.m4 index 74af8d037..12d40f28c 100644 --- a/ext/dom/config.m4 +++ b/ext/dom/config.m4 @@ -1,9 +1,9 @@ dnl -dnl $Id: config.m4,v 1.20 2005/05/29 23:16:40 sniper Exp $ +dnl $Id: config.m4,v 1.20.4.1 2007/07/03 17:25:33 sniper Exp $ dnl PHP_ARG_ENABLE(dom, whether to enable DOM support, -[ --disable-dom Disable new DOM support], yes) +[ --disable-dom Disable DOM support], yes) if test -z "$PHP_LIBXML_DIR"; then PHP_ARG_WITH(libxml-dir, libxml2 install dir, diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c index a82de197f..78e32988a 100644 --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_dom.c,v 1.73.2.12.2.10 2007/04/03 11:57:04 rrichards Exp $ */ +/* $Id: php_dom.c,v 1.73.2.12.2.11 2007/08/06 16:22:24 rrichards Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -411,7 +411,20 @@ static int dom_property_exists(zval *object, zval *member, int check_empty TSRML ret = zend_hash_find((HashTable *)obj->prop_handler, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, (void **) &hnd); } if (ret == SUCCESS) { - retval = 1; + zval *tmp; + + if (check_empty == 2) { + retval = 1; + } else if (hnd->read_func(obj, &tmp TSRMLS_CC) == SUCCESS) { + tmp->refcount = 1; + tmp->is_ref = 0; + if (check_empty == 1) { + retval = zend_is_true(tmp); + } else if (check_empty == 0) { + retval = (Z_TYPE_P(tmp) != IS_NULL); + } + zval_ptr_dtor(&tmp); + } } else { std_hnd = zend_get_std_object_handlers(); retval = std_hnd->has_property(object, member, check_empty TSRMLS_CC); diff --git a/ext/dom/tests/bug28721.phpt b/ext/dom/tests/bug28721.phpt index e8e7d867d..464498ef8 100644 --- a/ext/dom/tests/bug28721.phpt +++ b/ext/dom/tests/bug28721.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug # 28721: (appendChild() and insertBefore() unset DOMText) +Bug #28721 (appendChild() and insertBefore() unset DOMText) --SKIPIF-- <?php require_once('skipif.inc'); ?> --FILE-- diff --git a/ext/dom/tests/bug28817.phpt b/ext/dom/tests/bug28817.phpt index 26dd283c5..a250bff03 100644 --- a/ext/dom/tests/bug28817.phpt +++ b/ext/dom/tests/bug28817.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug # 28817: (properties in extended class) +Bug #28817 (properties in extended class) --SKIPIF-- <?php require_once('skipif.inc'); ?> --FILE-- diff --git a/ext/dom/tests/bug32615.phpt b/ext/dom/tests/bug32615.phpt index e48973429..c6f2b5bf8 100644 --- a/ext/dom/tests/bug32615.phpt +++ b/ext/dom/tests/bug32615.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug # 32615: (Replacing and inserting Fragments) +Bug #32615 (Replacing and inserting Fragments) --SKIPIF-- <?php require_once('skipif.inc'); ?> --FILE-- diff --git a/ext/dom/tests/bug34276.phpt b/ext/dom/tests/bug34276.phpt index 4a63943f7..fd265e58e 100644 --- a/ext/dom/tests/bug34276.phpt +++ b/ext/dom/tests/bug34276.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug # 34276: setAttributeNS and default namespace +Bug #34276 setAttributeNS and default namespace --SKIPIF-- <?php require_once('skipif.inc'); ?> --FILE-- diff --git a/ext/dom/tests/bug35342.phpt b/ext/dom/tests/bug35342.phpt index c07fd340d..3248c7339 100644 --- a/ext/dom/tests/bug35342.phpt +++ b/ext/dom/tests/bug35342.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug # 35342: isset(DOMNodeList->length) returns false +Bug #35342 isset(DOMNodeList->length) returns false --SKIPIF-- <?php require_once('skipif.inc'); ?> --FILE-- @@ -10,8 +10,11 @@ $dom->loadXML("<root><foo>foobar</foo><foo>foobar#2</foo></root>"); $nodelist = $dom->getElementsByTagName("foo"); var_dump($nodelist->length, isset($nodelist->length), isset($nodelist->foo)); +var_dump(empty($nodelist->length), empty($nodelist->foo)); ?> --EXPECT-- int(2) bool(true) bool(false) +bool(false) +bool(true) diff --git a/ext/dom/tests/bug37277.phpt b/ext/dom/tests/bug37277.phpt index 4a0168417..112b9f465 100644 --- a/ext/dom/tests/bug37277.phpt +++ b/ext/dom/tests/bug37277.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug # 37277 (cloning Dom Documents or Nodes does not work) +Bug #37277 (cloning Dom Documents or Nodes does not work) --SKIPIF-- <?php require_once('skipif.inc'); ?> --FILE-- diff --git a/ext/dom/tests/bug37456.phpt b/ext/dom/tests/bug37456.phpt index 904712f4b..5f0fc2877 100644 --- a/ext/dom/tests/bug37456.phpt +++ b/ext/dom/tests/bug37456.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug # 37456 (DOMElement->setAttribute() loops forever) +Bug #37456 (DOMElement->setAttribute() loops forever) --SKIPIF-- <?php require_once('skipif.inc'); ?> --FILE-- diff --git a/ext/dom/tests/bug38850.phpt b/ext/dom/tests/bug38850.phpt index c8ca93928..b0de90b88 100644 --- a/ext/dom/tests/bug38850.phpt +++ b/ext/dom/tests/bug38850.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug # 38850 (lookupNamespaceURI does not return default namespace) +Bug #38850 (lookupNamespaceURI does not return default namespace) --SKIPIF-- <?php require_once('skipif.inc'); ?> --FILE-- diff --git a/ext/dom/tests/bug38949.phpt b/ext/dom/tests/bug38949.phpt index ba9c8dfe3..4c81d9b73 100644 --- a/ext/dom/tests/bug38949.phpt +++ b/ext/dom/tests/bug38949.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug # 38949: (Cannot get xmlns value attribute) +Bug #38949 (Cannot get xmlns value attribute) --SKIPIF-- <?php require_once('skipif.inc'); ?> --FILE-- diff --git a/ext/dom/tests/bug40836.phpt b/ext/dom/tests/bug40836.phpt index 5f454c85e..b96b39cfe 100644 --- a/ext/dom/tests/bug40836.phpt +++ b/ext/dom/tests/bug40836.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug # 40836 (Segfault in insertBefore) +Bug #40836 (Segfault in insertBefore) --SKIPIF-- <?php require_once('skipif.inc'); ?> --FILE-- diff --git a/ext/dom/tests/bug41257.phpt b/ext/dom/tests/bug41257.phpt index 58e6acfd5..edf62a53a 100644 --- a/ext/dom/tests/bug41257.phpt +++ b/ext/dom/tests/bug41257.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug # 41257: (lookupNamespaceURI does not work as expected) +Bug #41257 (lookupNamespaceURI does not work as expected) --SKIPIF-- <?php require_once('skipif.inc'); ?> --FILE-- diff --git a/ext/dom/tests/bug41374.phpt b/ext/dom/tests/bug41374.phpt index 6de5ffbc0..21fc3454c 100644 --- a/ext/dom/tests/bug41374.phpt +++ b/ext/dom/tests/bug41374.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug # 41374: (wholetext concats values of wrong nodes) +Bug #41374 (wholetext concats values of wrong nodes) --SKIPIF-- <?php require_once('skipif.inc'); ?> --FILE-- diff --git a/ext/dom/tests/bug42082.phpt b/ext/dom/tests/bug42082.phpt new file mode 100644 index 000000000..3e20a6b13 --- /dev/null +++ b/ext/dom/tests/bug42082.phpt @@ -0,0 +1,27 @@ +--TEST-- +Bug #42082 (NodeList length zero should be empty) +--FILE-- +<?php +$doc = new DOMDocument(); +$xpath = new DOMXPath($doc); +$nodes = $xpath->query('*'); +var_dump($nodes); +var_dump($nodes->length); +$length = $nodes->length; +var_dump(empty($nodes->length), empty($lenght)); + +$doc->loadXML("<element></element>"); +var_dump($doc->firstChild->nodeValue, empty($doc->firstChild->nodeValue), isset($doc->firstChild->nodeValue)); +var_dump(empty($doc->nodeType), empty($doc->firstChild->nodeType)) +?> +--EXPECTF-- +object(DOMNodeList)#%d (0) { +} +int(0) +bool(true) +bool(true) +string(0) "" +bool(true) +bool(true) +bool(false) +bool(false) |
