WW-4628: new issues were introduced by last change, restoring old behavior and ignoring new tests

This commit is contained in:
cnenning
2016-08-01 15:42:36 +02:00
parent ae2840f183
commit 83bb64f4c2
2 changed files with 7 additions and 5 deletions
@@ -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();
@@ -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);