diff options
author | Rob Richards <rrichards@php.net> | 2005-03-10 22:32:47 +0000 |
---|---|---|
committer | Rob Richards <rrichards@php.net> | 2005-03-10 22:32:47 +0000 |
commit | 8462621bd7fe17bc9c54610ea9a4572e15428662 (patch) | |
tree | b87f17a0f11004ea72afd48e396820cf5237ec69 /ext/xmlreader/php_xmlreader.c | |
parent | cdb042f63272f817ecf372039d64469a99483d7a (diff) | |
download | php-git-8462621bd7fe17bc9c54610ea9a4572e15428662.tar.gz |
add workaround for libxml bug when using next() method
remove some no longer needed windows specific code
Diffstat (limited to 'ext/xmlreader/php_xmlreader.c')
-rw-r--r-- | ext/xmlreader/php_xmlreader.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/ext/xmlreader/php_xmlreader.c b/ext/xmlreader/php_xmlreader.c index 2cf7109011..191f878c91 100644 --- a/ext/xmlreader/php_xmlreader.c +++ b/ext/xmlreader/php_xmlreader.c @@ -776,22 +776,17 @@ PHP_METHOD(xmlreader, next) id = getThis(); intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); if (intern != NULL && intern->ptr != NULL) { +#if LIBXML_VERSION <= 20617 + /* Bug in libxml prevents a next in certain cases when positioned on end of element */ + if (xmlTextReaderNodeType(intern->ptr) == XML_READER_TYPE_END_ELEMENT) { + retval = xmlTextReaderRead(intern->ptr); + } else +#endif retval = xmlTextReaderNext(intern->ptr); while (name != NULL && retval == 1) { -#ifdef PHP_WIN32 - /* xmlTextReaderConstLocalName should be used once its added to win def libxml.def file. - Doing so will not require localname to be freed as its not allocated */ - xmlChar *localname = xmlTextReaderLocalName(intern->ptr); - if (xmlStrEqual(localname, name)) { - xmlFree(localname); - RETURN_TRUE; - } - xmlFree(localname); -#else if (xmlStrEqual(xmlTextReaderConstLocalName(intern->ptr), name)) { RETURN_TRUE; } -#endif retval = xmlTextReaderNext(intern->ptr); } if (retval == -1) { |