struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cnenn...@apache.org
Subject [1/2] struts git commit: WW-4628: new issues were introduced by last change, restoring old behavior and ignoring new tests
Date Mon, 01 Aug 2016 13:34:31 GMT
Repository: struts
Updated Branches:
  refs/heads/master ec9a24ec2 -> 7fdc103e8


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/a6b33018
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/a6b33018
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/a6b33018

Branch: refs/heads/master
Commit: a6b33018561f12724f89aa28f7849f3f2fc34092
Parents: af50018
Author: cnenning <cnenning@apache.org>
Authored: Mon Aug 1 15:33:21 2016 +0200
Committer: cnenning <cnenning@apache.org>
Committed: Mon Aug 1 15:33:21 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/a6b33018/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 1306a8f..16739af 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
@@ -180,11 +180,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/a6b33018/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&amp;param1=value1&amp;param2=value2&amp;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);


Mime
View raw message