diff --git a/core/src/main/java/org/apache/struts2/components/Anchor.java b/core/src/main/java/org/apache/struts2/components/Anchor.java index d05db59d2..51ca06323 100644 --- a/core/src/main/java/org/apache/struts2/components/Anchor.java +++ b/core/src/main/java/org/apache/struts2/components/Anchor.java @@ -22,7 +22,6 @@ package org.apache.struts2.components; import com.opensymphony.xwork2.inject.Inject; -import com.opensymphony.xwork2.util.TextUtils; import com.opensymphony.xwork2.util.ValueStack; import com.opensymphony.xwork2.util.logging.Logger; import com.opensymphony.xwork2.util.logging.LoggerFactory; diff --git a/core/src/main/java/org/apache/struts2/components/Property.java b/core/src/main/java/org/apache/struts2/components/Property.java index f6960af9a..5b1622fa4 100644 --- a/core/src/main/java/org/apache/struts2/components/Property.java +++ b/core/src/main/java/org/apache/struts2/components/Property.java @@ -24,11 +24,12 @@ package org.apache.struts2.components; import java.io.IOException; import java.io.Writer; +import org.apache.commons.lang.StringEscapeUtils; + import org.apache.struts2.views.annotations.StrutsTag; import org.apache.struts2.views.annotations.StrutsTagAttribute; import org.apache.struts2.StrutsConstants; -import com.opensymphony.xwork2.util.TextUtils; import com.opensymphony.xwork2.util.ValueStack; import com.opensymphony.xwork2.util.logging.Logger; import com.opensymphony.xwork2.util.logging.LoggerFactory; @@ -156,10 +157,10 @@ public class Property extends Component { private String prepare(String value) { String result = value; if (escape) { - result = TextUtils.htmlEncode(result); + result = StringEscapeUtils.escapeHtml(result); } if (escapeJavaScript) { - result = TextUtils.escapeJavaScript(result); + result = StringEscapeUtils.escapeJavaScript(result); } return result; } diff --git a/core/src/main/java/org/apache/struts2/components/ServletUrlRenderer.java b/core/src/main/java/org/apache/struts2/components/ServletUrlRenderer.java index 714c9e304..ac863e737 100644 --- a/core/src/main/java/org/apache/struts2/components/ServletUrlRenderer.java +++ b/core/src/main/java/org/apache/struts2/components/ServletUrlRenderer.java @@ -27,7 +27,6 @@ import com.opensymphony.xwork2.config.entities.ActionConfig; import com.opensymphony.xwork2.inject.Inject; import com.opensymphony.xwork2.util.logging.Logger; import com.opensymphony.xwork2.util.logging.LoggerFactory; -import com.opensymphony.xwork2.util.TextUtils; import org.apache.struts2.StrutsException; import org.apache.struts2.dispatcher.mapper.ActionMapper; import org.apache.struts2.dispatcher.mapper.ActionMapping; diff --git a/core/src/main/java/org/apache/struts2/components/Text.java b/core/src/main/java/org/apache/struts2/components/Text.java index 7d6e45619..8ed17e0af 100644 --- a/core/src/main/java/org/apache/struts2/components/Text.java +++ b/core/src/main/java/org/apache/struts2/components/Text.java @@ -32,7 +32,6 @@ import org.apache.struts2.views.annotations.StrutsTagAttribute; import org.apache.struts2.util.TextProviderHelper; import org.apache.commons.lang.xwork.StringUtils; -import com.opensymphony.xwork2.util.TextUtils; import com.opensymphony.xwork2.util.ValueStack; import com.opensymphony.xwork2.util.logging.Logger; import com.opensymphony.xwork2.util.logging.LoggerFactory; diff --git a/core/src/main/java/org/apache/struts2/util/StrutsUtil.java b/core/src/main/java/org/apache/struts2/util/StrutsUtil.java index f40c0d0ac..9607a3008 100644 --- a/core/src/main/java/org/apache/struts2/util/StrutsUtil.java +++ b/core/src/main/java/org/apache/struts2/util/StrutsUtil.java @@ -40,13 +40,14 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponseWrapper; +import org.apache.commons.lang.StringEscapeUtils; + import org.apache.struts2.views.jsp.ui.OgnlTool; import org.apache.struts2.views.util.UrlHelper; import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ObjectFactory; import com.opensymphony.xwork2.inject.Container; -import com.opensymphony.xwork2.util.TextUtils; import com.opensymphony.xwork2.util.ValueStack; import com.opensymphony.xwork2.util.logging.Logger; import com.opensymphony.xwork2.util.logging.LoggerFactory; @@ -228,7 +229,7 @@ public class StrutsUtil { return null; } - return TextUtils.htmlEncode(obj.toString()); + return StringEscapeUtils.escapeHtml(obj.toString()); } public int toInt(long aLong) {