summaryrefslogtreecommitdiff
path: root/ext/xml/compat.c
diff options
context:
space:
mode:
authorRob Richards <rrichards@php.net>2005-12-19 14:17:30 +0000
committerRob Richards <rrichards@php.net>2005-12-19 14:17:30 +0000
commitfc4ebee3e322fe06e13c2583f8c3df4e376449b9 (patch)
tree782f535c96524eaee32f6b590b7a4135725f8b7b /ext/xml/compat.c
parent2a130b19fcc99974ab1fb74522f8dbea3f505cdc (diff)
downloadphp-git-fc4ebee3e322fe06e13c2583f8c3df4e376449b9.tar.gz
MFH: Fixed bug #35447 (xml_parse_into_struct() chokes on the UTF-8 BOM)
add test
Diffstat (limited to 'ext/xml/compat.c')
-rw-r--r--ext/xml/compat.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/ext/xml/compat.c b/ext/xml/compat.c
index 43e116b864..7be85cab22 100644
--- a/ext/xml/compat.c
+++ b/ext/xml/compat.c
@@ -405,15 +405,12 @@ XML_ParserCreate_MM(const XML_Char *encoding, const XML_Memory_Handling_Suite *m
efree(parser);
return NULL;
}
- if (encoding != NULL) {
- parser->parser->encoding = xmlStrdup(encoding);
#if LIBXML_VERSION <= 20617
/* for older versions of libxml2, allow correct detection of
* charset in documents with a BOM: */
- } else {
- parser->parser->charset = XML_CHAR_ENCODING_NONE;
+ parser->parser->charset = XML_CHAR_ENCODING_NONE;
#endif
- }
+
parser->parser->replaceEntities = 1;
parser->parser->wellFormed = 0;
if (sep != NULL) {