diff --git a/ext/xml/compat.c b/ext/xml/compat.c index 19577ce17a89..8429761d7750 100644 --- a/ext/xml/compat.c +++ b/ext/xml/compat.c @@ -504,10 +504,10 @@ XML_GetErrorCode(XML_Parser parser) static const XML_Char *const error_mapping[] = { (const XML_Char *)"No error", + (const XML_Char *)"Internal error", (const XML_Char *)"No memory", (const XML_Char *)"Invalid document start", (const XML_Char *)"Empty document", - (const XML_Char *)"Not well-formed (invalid token)", (const XML_Char *)"Invalid document end", (const XML_Char *)"Invalid hexadecimal character reference", (const XML_Char *)"Invalid decimal character reference", diff --git a/ext/xml/tests/xml_error_string_libxml_codes.phpt b/ext/xml/tests/xml_error_string_libxml_codes.phpt new file mode 100644 index 000000000000..67ecc88eac00 --- /dev/null +++ b/ext/xml/tests/xml_error_string_libxml_codes.phpt @@ -0,0 +1,28 @@ +--TEST-- +xml_error_string() maps libxml error codes 1 to 5 to the matching messages +--EXTENSIONS-- +xml +--SKIPIF-- + +--FILE-- + +--EXPECT-- +int(4) +string(14) "Empty document" +string(14) "Internal error" +string(9) "No memory" +string(22) "Invalid document start" +string(14) "Empty document" +string(20) "Invalid document end"