aboutsummaryrefslogtreecommitdiffstats
path: root/xmlschemastypes.c
diff options
context:
space:
mode:
authorVincent Lefevre <vincent+gnome@vinc17.org>2009-08-07 16:42:24 +0200
committerDaniel Veillard <veillard@redhat.com>2009-08-07 16:42:24 +0200
commit933e5de96c406e669f8859557c960929e8f20741 (patch)
tree08164cb619942c625ecd7d1ae05d388d51ea43b1 /xmlschemastypes.c
parent9a15b30c7075393c080760998fdbc4349fcecadf (diff)
downloadandroid_external_libxml2-933e5de96c406e669f8859557c960929e8f20741.tar.gz
android_external_libxml2-933e5de96c406e669f8859557c960929e8f20741.tar.bz2
android_external_libxml2-933e5de96c406e669f8859557c960929e8f20741.zip
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
Diffstat (limited to 'xmlschemastypes.c')
-rw-r--r--xmlschemastypes.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/xmlschemastypes.c b/xmlschemastypes.c
index 0d967d07..1ce21e10 100644
--- a/xmlschemastypes.c
+++ b/xmlschemastypes.c
@@ -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);