chregu Thu Aug 19 08:29:44 2004 EDT Modified files: (Branch: PHP_5_0) /php-src NEWS /php-src/ext/xml compat.c xml.c Log: MFH - Fixed bug #29657 (xml_* functions throw non descriptive error). (Christian, Rob) - Fixed bug #29711 (Changed ext/xml to default to UTF-8 output). (Rob) http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.44&r2=1.1760.2.45&ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.1760.2.44 php-src/NEWS:1.1760.2.45 --- php-src/NEWS:1.1760.2.44 Mon Aug 16 08:34:20 2004 +++ php-src/NEWS Thu Aug 19 08:29:43 2004 @@ -1,6 +1,9 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2004, PHP 5.0.2 +- Fixed bug #29657 (xml_* functions throw non descriptive error). + (Christian, Rob) +- Fixed bug #29711 (Changed ext/xml to default to UTF-8 output). (Rob) - Fixed a file-descriptor leak with phpinfo() and other 'special' URLs (Zeev) - Added PHP_EOL constant that contains the OS way of representing newlines. (Paul Hudson, Derick) http://cvs.php.net/diff.php/php-src/ext/xml/compat.c?r1=1.32&r2=1.32.2.1&ty=u Index: php-src/ext/xml/compat.c diff -u php-src/ext/xml/compat.c:1.32 php-src/ext/xml/compat.c:1.32.2.1 --- php-src/ext/xml/compat.c:1.32 Wed Apr 7 12:24:17 2004 +++ php-src/ext/xml/compat.c Thu Aug 19 08:29:43 2004 @@ -463,9 +463,9 @@ "No error", "Internal error", "No memory", - "XML_ERR_DOCUMENT_START", + "Invalid document start", "Empty document", - "XML_ERR_DOCUMENT_END", + "Invalid document end", "Invalid hexadecimal character reference", "Invalid decimal character reference", "Invalid character reference", @@ -478,14 +478,14 @@ "XML_ERR_ENTITYREF_IN_PROLOG", "XML_ERR_ENTITYREF_IN_EPILOG", "XML_ERR_ENTITYREF_IN_DTD", - "XML_ERR_PEREF_AT_EOF", - "XML_ERR_PEREF_IN_PROLOG", - "XML_ERR_PEREF_IN_EPILOG", - "XML_ERR_PEREF_IN_INT_SUBSET", + "PEReference at end of document", + "PEReference in prolog", + "PEReference in epilog", + "PEReference: forbidden within markup decl in internal subset", "XML_ERR_ENTITYREF_NO_NAME", - "XML_ERR_ENTITYREF_SEMICOL_MISSING", - "XML_ERR_PEREF_NO_NAME", - "XML_ERR_PEREF_SEMICOL_MISSING", + "EntityRef: expecting ';'", + "PEReference: no name", + "PEReference: expecting ';'", "Undeclared entity error", "Undeclared entity warning", "Unparsed Entity", @@ -493,82 +493,82 @@ "XML_ERR_ENTITY_IS_PARAMETER", "Unknown encoding", "Unsupported encoding", - "XML_ERR_STRING_NOT_STARTED", - "XML_ERR_STRING_NOT_CLOSED", + "String not started expecting ' or \"", + "String not closed expecting \" or '", "Namespace declaration error", - "XML_ERR_ENTITY_NOT_STARTED", - "XML_ERR_ENTITY_NOT_FINISHED", - "XML_ERR_LT_IN_ATTRIBUTE", - "XML_ERR_ATTRIBUTE_NOT_STARTED", - "XML_ERR_ATTRIBUTE_NOT_FINISHED", - "XML_ERR_ATTRIBUTE_WITHOUT_VALUE", - "XML_ERR_ATTRIBUTE_REDEFINED", - "XML_ERR_LITERAL_NOT_STARTED", - "XML_ERR_LITERAL_NOT_FINISHED", + "EntityValue: \" or ' expected", + "EntityValue: \" or ' expected", + "< in attribute", + "Attribute not started", + "Attribute not finished", + "Attribute without value", + "Attribute redefined", + "SystemLiteral \" or ' expected", + "SystemLiteral \" or ' expected", /* "XML_ERR_COMMENT_NOT_STARTED", <= eliminated on purpose */ - "XML_ERR_COMMENT_NOT_FINISHED", - "XML_ERR_PI_NOT_STARTED", - "XML_ERR_PI_NOT_FINISHED", - "XML_ERR_NOTATION_NOT_STARTED", - "XML_ERR_NOTATION_NOT_FINISHED", - "XML_ERR_ATTLIST_NOT_STARTED", - "XML_ERR_ATTLIST_NOT_FINISHED", - "XML_ERR_MIXED_NOT_STARTED", + "Comment not finished", + "Processing Instruction not started", + "Processing Instruction not finished", + "NOTATION: Name expected here", + "'>' required to close NOTATION declaration", + "'(' required to start ATTLIST enumeration", + "'(' required to start ATTLIST enumeration", + "MixedContentDecl : '|' or ')*' expected", "XML_ERR_MIXED_NOT_FINISHED", - "XML_ERR_ELEMCONTENT_NOT_STARTED", - "XML_ERR_ELEMCONTENT_NOT_FINISHED", - "XML_ERR_XMLDECL_NOT_STARTED", - "XML_ERR_XMLDECL_NOT_FINISHED", + "ELEMENT in DTD not started", + "ELEMENT in DTD not finished", + "XML declaration not started", + "XML declaration not finished", "XML_ERR_CONDSEC_NOT_STARTED", - "XML_ERR_CONDSEC_NOT_FINISHED", - "XML_ERR_EXT_SUBSET_NOT_FINISHED", - "XML_ERR_DOCTYPE_NOT_FINISHED", - "XML_ERR_MISPLACED_CDATA_END", - "XML_ERR_CDATA_NOT_FINISHED", - "XML_ERR_RESERVED_XML_NAME", - "XML_ERR_SPACE_REQUIRED", + "XML conditional section not closed", + "Content error in the external subset", + "DOCTYPE not finished", + "Sequence ']]>' not allowed in content", + "CDATA not finished", + "Reserved XML Name", + "Space required", "XML_ERR_SEPARATOR_REQUIRED", - "XML_ERR_NMTOKEN_REQUIRED", + "NmToken expected in ATTLIST enumeration", "XML_ERR_NAME_REQUIRED", - "XML_ERR_PCDATA_REQUIRED", - "XML_ERR_URI_REQUIRED", - "XML_ERR_PUBID_REQUIRED", - "XML_ERR_LT_REQUIRED", - "XML_ERR_GT_REQUIRED", - "XML_ERR_LTSLASH_REQUIRED", - "XML_ERR_EQUAL_REQUIRED", - "XML_ERR_TAG_NAME_MISMATCH", - "XML_ERR_TAG_NOT_FINISHED", - "XML_ERR_STANDALONE_VALUE", - "XML_ERR_ENCODING_NAME", - "XML_ERR_HYPHEN_IN_COMMENT", + "MixedContentDecl : '#PCDATA' expected", + "SYSTEM or PUBLIC, the URI is missing", + "PUBLIC, the Public Identifier is missing", + "< required", + "> required", + "</ required", + "= required", + "Mismatched tag", + "Tag not finished", + "standalone accepts only 'yes' or 'no'", + "Invalid XML encoding name", + "Comment must not contain '--' (double-hyphen)", "Invalid encoding", - "XML_ERR_EXT_ENTITY_STANDALONE", - "XML_ERR_CONDSEC_INVALID", - "XML_ERR_VALUE_REQUIRED", - "XML_ERR_NOT_WELL_BALANCED", - "XML_ERR_EXTRA_CONTENT", + "external parsed entities cannot be standalone", + "XML conditional section '[' expected", + "Entity value required", + "chunk is not well balanced", + "extra content at the end of well balanced chunk", "XML_ERR_ENTITY_CHAR_ERROR", - "XML_ERR_ENTITY_PE_INTERNAL", - "XML_ERR_ENTITY_LOOP", + "PEReferences forbidden in internal subset", + "Detected an entity reference loop", "XML_ERR_ENTITY_BOUNDARY", "Invalid URI", - "XML_ERR_URI_FRAGMENT", + "Fragment not allowed", "XML_WAR_CATALOG_PI", "XML_ERR_NO_DTD", - "XML_ERR_CONDSEC_INVALID_KEYWORD", /* 95 */ - "XML_ERR_VERSION_MISSING", /* 96 */ + "conditional section INCLUDE or IGNORE keyword expected", /* 95 */ + "Version in XML Declaration missing", /* 96 */ "XML_WAR_UNKNOWN_VERSION", /* 97 */ "XML_WAR_LANG_VALUE", /* 98 */ "XML_WAR_NS_URI", /* 99 */ "XML_WAR_NS_URI_RELATIVE", /* 100 */ - "XML_ERR_MISSING_ENCODING" /* 101 */ + "Missing encoding in text declaration" /* 101 */ }; PHPAPI const XML_Char * XML_ErrorString(int code) { - if (code < 0 || code >= (int)sizeof(error_mapping)) { + if (code < 0 || code >= (int)(sizeof(error_mapping) / sizeof(error_mapping[0]))) { return "Unknown"; } return error_mapping[code]; http://cvs.php.net/diff.php/php-src/ext/xml/xml.c?r1=1.151&r2=1.151.2.1&ty=u Index: php-src/ext/xml/xml.c diff -u php-src/ext/xml/xml.c:1.151 php-src/ext/xml/xml.c:1.151.2.1 --- php-src/ext/xml/xml.c:1.151 Wed Apr 7 12:24:17 2004 +++ php-src/ext/xml/xml.c Thu Aug 19 08:29:43 2004 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: xml.c,v 1.151 2004/04/07 16:24:17 rrichards Exp $ */ +/* $Id: xml.c,v 1.151.2.1 2004/08/19 12:29:43 chregu Exp $ */ #define IS_EXT_MODULE @@ -176,7 +176,7 @@ #ifdef ZTS static void php_xml_init_globals(php_xml_globals *xml_globals_p TSRMLS_DC) { - XML(default_encoding) = "ISO-8859-1"; + XML(default_encoding) = "UTF-8"; } #endif @@ -204,7 +204,7 @@ #ifdef ZTS ts_allocate_id(&xml_globals_id, sizeof(php_xml_globals), (ts_allocate_ctor) php_xml_init_globals, NULL); #else - XML(default_encoding) = "ISO-8859-1"; + XML(default_encoding) = "UTF-8"; #endif REGISTER_LONG_CONSTANT("XML_ERROR_NONE", XML_ERROR_NONE, CONST_CS|CONST_PERSISTENT);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php