Author: chris.laprun(a)jboss.com
Date: 2009-03-25 21:15:51 -0400 (Wed, 25 Mar 2009)
New Revision: 13085
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/WSRPPortletURL.java
Log:
- JBPORTAL-2355: Do not encode & in URLs as contract for toString is supposed to be
non-XML encoded URLs... Needs more testing in particular with other WSRP consumers.
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/WSRPPortletURL.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/WSRPPortletURL.java 2009-03-25
16:01:29 UTC (rev 13084)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/WSRPPortletURL.java 2009-03-26
01:15:51 UTC (rev 13085)
@@ -51,12 +51,14 @@
private static final Logger log = Logger.getLogger(WSRPPortletURL.class);
private static final String EQUALS = "=";
- private static final String AMPERSAND = "&";
+ private static final String ENCODED_AMPERSAND = "&";
+ private static final String AMPERSAND = "&";
private static final String PARAM_SEPARATOR = "|";
+
private static final int URL_TYPE_END = WSRPRewritingConstants.URL_TYPE_NAME.length()
+ EQUALS.length();
-
private boolean secure;
private Mode mode;
+
private WindowState windowState;
/** Are we using strict rewriting parameters validation mode? */
@@ -64,7 +66,6 @@
/** Holds extra parameters if we are in relaxed validation mode */
private Map<String, String> extraParams;
-
/** Remember position of extra parameters wrt end token */
private boolean extraParamsAfterEndToken = false;
@@ -173,9 +174,8 @@
}
// standardize parameter separators
- encodedURL = Tools.replace(encodedURL, "&amp;", PARAM_SEPARATOR);
// sanitize doubly encoded & fix-me: should be removed?
+ encodedURL = Tools.replace(encodedURL, ENCODED_AMPERSAND, PARAM_SEPARATOR);
encodedURL = Tools.replace(encodedURL, AMPERSAND, PARAM_SEPARATOR);
- encodedURL = Tools.replace(encodedURL, "&", PARAM_SEPARATOR); // this
second shouldn't be used but in case it is...
// remove url type param name and extract value
encodedURL = encodedURL.substring(URL_TYPE_END);
Show replies by date