You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by cn...@apache.org on 2016/08/01 13:42:58 UTC
struts git commit: WW-4628: new issues were introduced by last change,
restoring old behavior and ignoring new tests
Repository: struts
Updated Branches:
refs/heads/support-2-3 ae2840f18 -> 83bb64f4c
WW-4628: new issues were introduced by last change, restoring old behavior and ignoring new tests
Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/83bb64f4
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/83bb64f4
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/83bb64f4
Branch: refs/heads/support-2-3
Commit: 83bb64f4c232348c4162ad2272c7eae1855a7362
Parents: ae2840f
Author: cnenning <cn...@apache.org>
Authored: Mon Aug 1 15:42:36 2016 +0200
Committer: cnenning <cn...@apache.org>
Committed: Mon Aug 1 15:42:36 2016 +0200
----------------------------------------------------------------------
.../java/org/apache/struts2/views/util/DefaultUrlHelper.java | 5 ++---
.../org/apache/struts2/views/util/DefaultUrlHelperTest.java | 7 +++++--
2 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/struts/blob/83bb64f4/core/src/main/java/org/apache/struts2/views/util/DefaultUrlHelper.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/views/util/DefaultUrlHelper.java b/core/src/main/java/org/apache/struts2/views/util/DefaultUrlHelper.java
index 05895f0..8aacf63 100644
--- a/core/src/main/java/org/apache/struts2/views/util/DefaultUrlHelper.java
+++ b/core/src/main/java/org/apache/struts2/views/util/DefaultUrlHelper.java
@@ -190,11 +190,10 @@ public class DefaultUrlHelper implements UrlHelper {
}
//if the action was not explicitly set grab the params from the request
- //always pass encode=false here as encoding might happen for complete URL later
if (escapeAmp) {
- buildParametersString(params, link, AMP, false);
+ buildParametersString(params, link, AMP, true);
} else {
- buildParametersString(params, link, "&", false);
+ buildParametersString(params, link, "&", true);
}
String result = link.toString();
http://git-wip-us.apache.org/repos/asf/struts/blob/83bb64f4/core/src/test/java/org/apache/struts2/views/util/DefaultUrlHelperTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/struts2/views/util/DefaultUrlHelperTest.java b/core/src/test/java/org/apache/struts2/views/util/DefaultUrlHelperTest.java
index aa66602..57786c4 100644
--- a/core/src/test/java/org/apache/struts2/views/util/DefaultUrlHelperTest.java
+++ b/core/src/test/java/org/apache/struts2/views/util/DefaultUrlHelperTest.java
@@ -27,6 +27,7 @@ import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.Scope.Strategy;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.StrutsInternalTestCase;
+import org.junit.Ignore;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -128,7 +129,8 @@ public class DefaultUrlHelperTest extends StrutsInternalTestCase {
expectedUrl, url.toString());
}
- public void testBuildUrlWithJavaScriptInjected() throws Exception {
+ @Ignore
+ public void ignoreTestBuildUrlWithJavaScriptInjected() throws Exception {
String expectedUrl = "http://localhost:8080/myContext/myPage.jsp?initParam=initValue&param1=value1&param2=value2&param3%22%3Cscript+type%3D%22text%2Fjavascript%22%3Ealert%281%29%3B%3C%2Fscript%3E=value3";
// there is explicit escaping for EcmaScript before URL encoding
@@ -421,7 +423,8 @@ public class DefaultUrlHelperTest extends StrutsInternalTestCase {
assertEquals(result, expectedResult);
}
- public void testDontEncode() throws Exception {
+ @Ignore
+ public void ignoreTestDontEncode() throws Exception {
String expectedUrl = "http://localhost/contextPath/myAction.action?param1=value+with+spaces";
Mock mockHttpServletRequest = new Mock(HttpServletRequest.class);