summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2023-05-09 03:25:24 +0200
committerNick Wellnhofer <wellnhofer@aevum.de>2023-05-09 03:25:24 +0200
commitb8961df65d077457863780892f2d39ac4c04c0af (patch)
treec93913ab319744ece3832bb0a35bb1267bb23c1a
parentf24ffddbb915121d70d9cb77761339148fce1eec (diff)
downloadlibxml2-b8961df65d077457863780892f2d39ac4c04c0af.tar.gz
SAX: Always validate xml:ids
The behavior shouldn't depend on mostly random configuration options.
-rw-r--r--SAX2.c4
-rw-r--r--include/libxml/tree.h6
-rw-r--r--tree.c2
3 files changed, 0 insertions, 12 deletions
diff --git a/SAX2.c b/SAX2.c
index 91019389..474ea372 100644
--- a/SAX2.c
+++ b/SAX2.c
@@ -2174,15 +2174,11 @@ xmlSAX2AttributeNs(xmlParserCtxtPtr ctxt,
*
* Open issue: normalization of the value.
*/
-#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
-#ifdef LIBXML_VALID_ENABLED
if (xmlValidateNCName(content, 1) != 0) {
xmlErrValid(ctxt, XML_DTD_XMLID_VALUE,
"xml:id : attribute value %s is not an NCName\n",
(const char *) content, NULL);
}
-#endif
-#endif
xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret);
} else if (xmlIsID(ctxt->myDoc, ctxt->node, ret)) {
xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret);
diff --git a/include/libxml/tree.h b/include/libxml/tree.h
index b4989667..a1cabf69 100644
--- a/include/libxml/tree.h
+++ b/include/libxml/tree.h
@@ -657,15 +657,9 @@ struct _xmlDOMWrapCtxt {
/*
* Some helper functions
*/
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || \
- defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || \
- defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || \
- defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || \
- defined(LIBXML_LEGACY_ENABLED)
XMLPUBFUN int
xmlValidateNCName (const xmlChar *value,
int space);
-#endif
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
XMLPUBFUN int
diff --git a/tree.c b/tree.c
index eae778d6..6c8a875b 100644
--- a/tree.c
+++ b/tree.c
@@ -357,7 +357,6 @@ xmlSplitQName3(const xmlChar *name, int *len) {
#define CUR_SCHAR(s, l) xmlStringCurrentChar(NULL, s, &l)
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
/**
* xmlValidateNCName:
* @value: the value to check
@@ -429,7 +428,6 @@ try_complex:
return(0);
}
-#endif
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
/**