1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-13 20:58:16 +03:00

Bug 565747 – relax anyURI data character checking

* xmlschemastypes.c: anyURI values that contain an apostrophe or a
  space character or any non-ascii char were rejected, this is opposed
  to XSD-1.0 datatype rules
This commit is contained in:
Vincent Lefevre 2009-08-07 16:42:24 +02:00 committed by Daniel Veillard
parent 9a15b30c70
commit 933e5de96c

View File

@ -2899,12 +2899,23 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value,
case XML_SCHEMAS_ANYURI:{
if (*value != 0) {
xmlURIPtr uri;
xmlChar *tmpval, *cur;
if (normOnTheFly) {
norm = xmlSchemaCollapseString(value);
if (norm != NULL)
value = norm;
}
uri = xmlParseURI((const char *) value);
tmpval = xmlStrdup(value);
for (cur = tmpval; *cur; ++cur) {
if (*cur < 32 || *cur >= 127 || *cur == ' ' ||
*cur == '<' || *cur == '>' || *cur == '"' ||
*cur == '{' || *cur == '}' || *cur == '|' ||
*cur == '\\' || *cur == '^' || *cur == '`' ||
*cur == '\'')
*cur = '_';
}
uri = xmlParseURI((const char *) tmpval);
xmlFree(tmpval);
if (uri == NULL)
goto return1;
xmlFreeURI(uri);