mirror of
https://github.com/apache/struts.git
synced 2026-08-07 07:37:20 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user