Skip to content

Commit

Permalink
WW-4915 Replace deprecated commons-lang3 classes (replace StringEscap…
Browse files Browse the repository at this point in the history
…eUtils.escapeXml with StringEscapeUtils.escapeXml10)
  • Loading branch information
aleksandr-m committed Feb 5, 2018
1 parent eb6ea76 commit dac6244
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions core/src/main/java/org/apache/struts2/components/Property.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
package org.apache.struts2.components;

import com.opensymphony.xwork2.util.ValueStack;
import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.text.StringEscapeUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.views.annotations.StrutsTag;
Expand Down Expand Up @@ -162,15 +162,15 @@ public boolean start(Writer writer) {
}

private String prepare(String value) {
String result = value;
String result = value;
if (escapeHtml) {
result = StringEscapeUtils.escapeHtml4(result);
result = StringEscapeUtils.escapeHtml4(result);
}
if (escapeJavaScript) {
result = StringEscapeUtils.escapeEcmaScript(result);
result = StringEscapeUtils.escapeEcmaScript(result);
}
if (escapeXml) {
result = StringEscapeUtils.escapeXml(result);
result = StringEscapeUtils.escapeXml10(result);
}
if (escapeCsv) {
result = StringEscapeUtils.escapeCsv(result);
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/org/apache/struts2/components/Text.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
package org.apache.struts2.components;

import com.opensymphony.xwork2.util.ValueStack;
import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.text.StringEscapeUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand Down Expand Up @@ -225,7 +225,7 @@ private String prepare(String value) {
result = StringEscapeUtils.escapeEcmaScript(result);
}
if (escapeXml) {
result = StringEscapeUtils.escapeXml(result);
result = StringEscapeUtils.escapeXml10(result);
}
if (escapeCsv) {
result = StringEscapeUtils.escapeCsv(result);
Expand Down

0 comments on commit dac6244

Please sign in to comment.