WW-2414 - failsafe sanitization of querystring params

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@614814 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James Mitchell
2008-01-24 07:39:45 +00:00
parent 28ee8f79d1
commit 09147ffad2
@@ -174,10 +174,14 @@ public class UrlHelper {
buildParametersString(params, link, "&");
}
String result;
String result = link.toString();
if (result.indexOf("<script>") >= 0){
result = result.replaceAll("<script>", "script");
}
try {
result = encodeResult ? response.encodeURL(link.toString()) : link.toString();
result = encodeResult ? response.encodeURL(result) : result;
} catch (Exception ex) {
// Could not encode the URL for some reason
// Use it unchanged