summaryrefslogtreecommitdiff
path: root/ext/xmlreader/php_xmlreader.c
diff options
context:
space:
mode:
authorRob Richards <rrichards@php.net>2005-03-10 22:32:47 +0000
committerRob Richards <rrichards@php.net>2005-03-10 22:32:47 +0000
commit8462621bd7fe17bc9c54610ea9a4572e15428662 (patch)
treeb87f17a0f11004ea72afd48e396820cf5237ec69 /ext/xmlreader/php_xmlreader.c
parentcdb042f63272f817ecf372039d64469a99483d7a (diff)
downloadphp-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.c17
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) {