cvs: php-src(PHP_5_0) /ext/xml compat.c
| From: | Rob Richards | Date: | Thu, 18 Nov 2004 18:27:00 +0000 |
| Subject: | cvs: php-src(PHP_5_0) /ext/xml compat.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-29253@lists.php.net to get a copy of this message | ||
rrichards Thu Nov 18 13:27:00 2004 EDT
Modified files: (Branch: PHP_5_0)
/php-src/ext/xml compat.c
Log:
MFH: Fixed bug #30832 ("!" stripped off comments in xml parser)
reset sax->initialized flag when not using SAX2
http://cvs.php.net/diff.php/php-src/ext/xml/compat.c?r1=1.32.2.3&r2=1.32.2.4&ty=u
Index: php-src/ext/xml/compat.c
diff -u php-src/ext/xml/compat.c:1.32.2.3 php-src/ext/xml/compat.c:1.32.2.4
--- php-src/ext/xml/compat.c:1.32.2.3 Thu Nov 18 11:36:34 2004
+++ php-src/ext/xml/compat.c Thu Nov 18 13:26:59 2004
@@ -211,12 +211,12 @@
static void
_build_comment(const xmlChar *data, int data_len, xmlChar **comment, int *comment_len)
{
- *comment_len = data_len + 6;
+ *comment_len = data_len + 7;
*comment = xmlMalloc(*comment_len + 1);
- memcpy(*comment, "<--", 3);
- memcpy(*comment + 3, data, data_len);
- memcpy(*comment + 3 + data_len, "-->", 3);
+ memcpy(*comment, "<!--", 4);
+ memcpy(*comment + 4, data, data_len);
+ memcpy(*comment + 4 + data_len, "-->", 3);
(*comment)[*comment_len] = '\0';
}
@@ -359,6 +359,12 @@
parser->parser->sax2 = 1;
#endif
parser->_ns_seperator = xmlStrdup(sep);
+#if LIBXML_VERSION >= 20600
+ } else {
+ /* Reset flag as XML_SAX2_MAGIC is needed for xmlCreatePushParserCtxt
+ so must be set in the handlers */
+ parser->parser->sax->initialized = 1;
+#endif
}
return parser;
}