rrichards Wed Aug 20 14:58:03 2003 EDT Modified files: /php-src/ext/dom php_dom.c Log: fix infinite loop in normalize Index: php-src/ext/dom/php_dom.c diff -u php-src/ext/dom/php_dom.c:1.25 php-src/ext/dom/php_dom.c:1.26 --- php-src/ext/dom/php_dom.c:1.25 Mon Aug 18 21:30:25 2003 +++ php-src/ext/dom/php_dom.c Wed Aug 20 14:58:03 2003 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_dom.c,v 1.25 2003/08/19 01:30:25 wez Exp $ */ +/* $Id: php_dom.c,v 1.26 2003/08/20 18:58:03 rrichards Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1122,7 +1122,7 @@ /* {{{ void dom_normalize (xmlNodePtr nodep TSRMLS_DC) */ void dom_normalize (xmlNodePtr nodep TSRMLS_DC) { - xmlNodePtr child, nextp; + xmlNodePtr child, nextp, newnextp; xmlAttrPtr attr; xmlChar *strContent; @@ -1133,12 +1133,15 @@ nextp = child->next; while (nextp != NULL) { if (nextp->type == XML_TEXT_NODE) { + newnextp = nextp->next; strContent = xmlNodeGetContent(nextp); xmlNodeAddContent(child, strContent); xmlFree(strContent); xmlUnlinkNode(nextp); node_free_resource(nextp TSRMLS_CC); - nextp = child->next; + nextp = newnextp; + } else { + break; } } break;
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php