This is an automated email from the ASF dual-hosted git repository.
veithen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ws-axiom.git
The following commit(s) were added to refs/heads/master by this push:
new 42f49b433 Properly validate names passed to createElement
42f49b433 is described below
commit 42f49b43365f3653d6530acdec26cdf9276ddb23
Author: Andreas Veithen <[email protected]>
AuthorDate: Sun Dec 17 18:19:06 2023 +0000
Properly validate names passed to createElement
---
.../org/apache/axiom/om/impl/dom/W3CDOMLevel1ImplementationTest.java | 3 ---
.../main/java/org/apache/axiom/dom/impl/mixin/DOMDocumentMixin.java | 1 +
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git
a/implementations/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/W3CDOMLevel1ImplementationTest.java
b/implementations/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/W3CDOMLevel1ImplementationTest.java
index 08eab0cb2..e72088892 100644
---
a/implementations/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/W3CDOMLevel1ImplementationTest.java
+++
b/implementations/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/W3CDOMLevel1ImplementationTest.java
@@ -31,7 +31,6 @@ public class W3CDOMLevel1ImplementationTest extends TestCase {
builder.exclude(W3CTestCase.class,
"(id=http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrspecifiedvalueremove)");
builder.exclude(W3CTestCase.class,
"(id=http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentcreateelementdefaultattr)");
builder.exclude(W3CTestCase.class,
"(id=http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentgetelementsbytagnametotallength)");
- builder.exclude(W3CTestCase.class,
"(id=http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentinvalidcharacterexceptioncreateelement)");
builder.exclude(W3CTestCase.class,
"(id=http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentinvalidcharacterexceptioncreateentref)");
builder.exclude(W3CTestCase.class,
"(id=http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentinvalidcharacterexceptioncreateentref1)");
builder.exclude(W3CTestCase.class,
"(id=http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentinvalidcharacterexceptioncreatepi)");
@@ -42,8 +41,6 @@ public class W3CDOMLevel1ImplementationTest extends TestCase {
builder.exclude(W3CTestCase.class,
"(id=http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapremovenameditem)");
builder.exclude(W3CTestCase.class,
"(id=http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapremovenameditemgetvalue)");
builder.exclude(W3CTestCase.class,
"(id=http://www.w3.org/2001/DOM-Test-Suite/level1/core/processinginstructionsetdatanomodificationallowederr)");
- builder.exclude(W3CTestCase.class,
"(id=http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentinvalidcharacterexceptioncreateelement)");
- builder.exclude(W3CTestCase.class,
"(id=http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentinvalidcharacterexceptioncreateelement1)");
builder.exclude(W3CTestCase.class,
"(id=http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementnormalize)");
builder.exclude(W3CTestCase.class,
"(id=http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementnormalize2)");
builder.exclude(W3CTestCase.class,
"(id=http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrgetvalue2)");
diff --git
a/mixins/dom-mixins/src/main/java/org/apache/axiom/dom/impl/mixin/DOMDocumentMixin.java
b/mixins/dom-mixins/src/main/java/org/apache/axiom/dom/impl/mixin/DOMDocumentMixin.java
index 32c3dc7f7..26e0d8959 100644
---
a/mixins/dom-mixins/src/main/java/org/apache/axiom/dom/impl/mixin/DOMDocumentMixin.java
+++
b/mixins/dom-mixins/src/main/java/org/apache/axiom/dom/impl/mixin/DOMDocumentMixin.java
@@ -232,6 +232,7 @@ public abstract class DOMDocumentMixin implements
DOMDocument {
@Override
public final Element createElement(String tagName) {
+ NSUtil.validateName(tagName);
DOMNSUnawareElement element =
getDOMNodeFactory().createNSUnawareElement();
element.coreSetOwnerDocument(this);
element.coreSetName(tagName);