[ 
https://issues.apache.org/jira/browse/WICKET-2131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12677063#action_12677063
 ] 

Martijn Dashorst commented on WICKET-2131:
------------------------------------------

This requires a couple more tweaks than just one location...

Index: 
../../wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/request/WebRequestCodingStrategy.java
===================================================================
--- 
../../wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/request/WebRequestCodingStrategy.java
       (revision 746413)
+++ 
../../wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/request/WebRequestCodingStrategy.java
       (working copy)
@@ -909,7 +909,7 @@
 
                if 
(IActivePageBehaviorListener.INTERFACE.getName().equals(listenerName))
                {
-                       url.append(url.indexOf("?") > -1 ? "&" : "?").append(
+                       url.append(url.indexOf("?") > -1 ? "&" : 
"?").append(
                                
IGNORE_IF_NOT_ACTIVE_PARAMETER_NAME).append("=true");
                }
                return url;
Index: 
../../wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/request/target/coding/WebRequestEncoder.java
===================================================================
--- 
../../wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/request/target/coding/WebRequestEncoder.java
      (revision 746413)
+++ 
../../wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/request/target/coding/WebRequestEncoder.java
      (working copy)
@@ -75,9 +75,9 @@
         */
        public void addValue(String key, String value)
        {
-        if (!firstParameter)
+               if (!firstParameter)
                {
-                       url.append('&');
+                       url.append("&");
                }
                else
                {
Index: 
../../wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/RequestCycle.java
===================================================================
--- 
../../wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/RequestCycle.java
 (revision 746413)
+++ 
../../wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/RequestCycle.java
 (working copy)
@@ -886,7 +886,7 @@
                                        final Map.Entry entry = 
(Entry)it.next();
                                        final String key = 
entry.getKey().toString();
                                        final String value = 
entry.getValue().toString();
-                                       buff.append("&");
+                                       buff.append("&");
                                        buff.append(encodeQueryStringItem(key));
                                        buff.append("=");
                                        
buff.append(encodeQueryStringItem(value));


> RequestCycle.urlFor does not escape & properly
> ----------------------------------------------
>
>                 Key: WICKET-2131
>                 URL: https://issues.apache.org/jira/browse/WICKET-2131
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.5
>            Reporter: Emond Papegaaij
>             Fix For: 1.3.6
>
>
> RequestCycle.urlFor(final Component, RequestListenerInterface, ValueMap) adds 
> an unescaped & to the url ("buff.append("&");"), it should include a &.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to