From: Uwe Steinmann Date: Thu, 17 Feb 2000 20:30:00 +0000 (+0000) Subject: - fixed bug if attribute value is entity X-Git-Tag: php-4.0b4_rc1~42 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d526de3fa8c8c7593822a7695b6b1c234c75f9ba;p=php - fixed bug if attribute value is entity --- diff --git a/ext/domxml/domxml.c b/ext/domxml/domxml.c index 6fc14137bf..fac667d2e2 100644 --- a/ext/domxml/domxml.c +++ b/ext/domxml/domxml.c @@ -530,7 +530,8 @@ PHP_FUNCTION(domxml_attributes) } while(attr) { - add_assoc_string(return_value, (char *) attr->name, attr->val->content, 1); + if(attr->val->content) + add_assoc_string(return_value, (char *) attr->name, attr->val->content, 1); attr = attr->next; } } @@ -907,7 +908,8 @@ static int node_attributes(zval **attributes, xmlNode *nodep) object_init_ex(pattr, domxmlattr_class_entry_ptr); add_property_resource(pattr, "attribute", ret); add_property_stringl(pattr, "name", (char *) attr->name, strlen(attr->name), 1); - add_property_stringl(pattr, "value", (char *) attr->val->content, strlen(attr->val->content), 1); + if(attr->val->content) + add_property_stringl(pattr, "value", (char *) attr->val->content, strlen(attr->val->content), 1); zend_hash_next_index_insert((*attributes)->value.ht, &pattr, sizeof(zval *), NULL); attr = attr->next; } diff --git a/tests/testdom b/tests/testdom index 4593fe05da..4b5415d521 100644 --- a/tests/testdom +++ b/tests/testdom @@ -38,7 +38,7 @@ $xmlstr = " Title - + a1b1c1