
## Review A dedicated reviewer checked the rule description successfully for: - [ ] logical errors and incorrect information - [ ] information gaps and missing content - [ ] text style and tone - [ ] PR summary and labels follow [the guidelines](https://github.com/SonarSource/rspec/#to-modify-an-existing-rule)
24 lines
510 B
Plaintext
24 lines
510 B
Plaintext
== How to fix it in Dom4j
|
|
|
|
=== Code examples
|
|
|
|
==== Noncompliant code example
|
|
|
|
[source,java,diff-id=2,diff-type=noncompliant]
|
|
----
|
|
import org.dom4j.io.SAXReader;
|
|
|
|
SAXReader xmlReader = new SAXReader();
|
|
xmlReader.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, false); // Noncompliant
|
|
----
|
|
|
|
==== Compliant solution
|
|
|
|
[source,java,diff-id=2,diff-type=compliant]
|
|
----
|
|
import org.dom4j.io.SAXReader;
|
|
|
|
SAXReader xmlReader = new SAXReader();
|
|
xmlReader.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
|
|
----
|