diff --git a/catalog/transformer/catalog-transformer-preview/pom.xml b/catalog/transformer/catalog-transformer-preview/pom.xml
index 44a9b391920d..848b3f7b78da 100644
--- a/catalog/transformer/catalog-transformer-preview/pom.xml
+++ b/catalog/transformer/catalog-transformer-preview/pom.xml
@@ -52,6 +52,11 @@
catalog-transformer-common
${project.version}
+
+ org.apache.commons
+ commons-text
+ ${commons-text.version}
+
@@ -66,7 +71,8 @@
catalog-core-api-impl,
- catalog-core-actions
+ catalog-core-actions,
+ commons-text
!org.codice.ddf.platform.util,
diff --git a/catalog/transformer/catalog-transformer-preview/src/main/java/org/codice/ddf/transformer/preview/PreviewMetacardTransformer.java b/catalog/transformer/catalog-transformer-preview/src/main/java/org/codice/ddf/transformer/preview/PreviewMetacardTransformer.java
index e23f8678b461..3009e96d9e43 100644
--- a/catalog/transformer/catalog-transformer-preview/src/main/java/org/codice/ddf/transformer/preview/PreviewMetacardTransformer.java
+++ b/catalog/transformer/catalog-transformer-preview/src/main/java/org/codice/ddf/transformer/preview/PreviewMetacardTransformer.java
@@ -21,6 +21,7 @@
import ddf.catalog.transform.MetacardTransformer;
import java.io.Serializable;
import java.util.Map;
+import org.apache.commons.text.StringEscapeUtils;
import org.apache.tika.io.IOUtils;
public class PreviewMetacardTransformer implements MetacardTransformer {
@@ -36,10 +37,8 @@ public BinaryContent transform(Metacard metacard, Map argu
if (metacard.getAttribute(Extracted.EXTRACTED_TEXT) != null
&& metacard.getAttribute(Extracted.EXTRACTED_TEXT).getValue() != null) {
preview =
- metacard
- .getAttribute(Extracted.EXTRACTED_TEXT)
- .getValue()
- .toString()
+ StringEscapeUtils.escapeHtml4(
+ metacard.getAttribute(Extracted.EXTRACTED_TEXT).getValue().toString())
.replaceAll("[\n|\r]", "
");
preview = String.format("%s", preview);
}
diff --git a/features/cxf/src/main/feature/feature.xml b/features/cxf/src/main/feature/feature.xml
index f8990d9d9289..f452bebcb0e4 100644
--- a/features/cxf/src/main/feature/feature.xml
+++ b/features/cxf/src/main/feature/feature.xml
@@ -663,7 +663,7 @@
mvn:org.apache.commons/commons-lang3/${cxf.commons-lang3.version}
- mvn:org.apache.commons/commons-text/1.2
+ mvn:org.apache.commons/commons-text/${commons-text.version}
wrap:mvn:org.apache.velocity/velocity-engine-core/${cxf.velocity.version}
diff --git a/pom.xml b/pom.xml
index e4919c4a411a..91783184b3c0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -188,6 +188,7 @@
1.2
3.5
1.6
+ 1.2
1.6
4.7.0
0.1.4