[ 
https://issues.apache.org/jira/browse/WICKET-1597?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Juergen Donnerstag updated WICKET-1597:
---------------------------------------

    Attachment: wicket-1597.patch

Applied the change and modified the test cases. Since I wasn't sure if 
/a/?param is the same as /a?param, I didn't commit it but attached the patch.

> MixedParamUrlCodingStrategy bugs
> --------------------------------
>
>                 Key: WICKET-1597
>                 URL: https://issues.apache.org/jira/browse/WICKET-1597
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.3
>         Environment: Firefox
>            Reporter: Doug Donohoe
>            Assignee: Matej Knopp
>            Priority: Minor
>             Fix For: 1.4-RC2
>
>         Attachments: FixedMixedParamUrlCodingStrategy.java, 
> patch-MixedParamUrlCodingStrategy-WICKET-1597.diff, 
> patch-MixedParamUrlCodingStrategyTest-WICKET-1597.diff, wicket-1597.patch
>
>
> If a parameter is missing, it is default to "" as seen below.
>                if (foundParameter)
>               {
>                       for (int i = 0; i <= lastSpecifiedParameter; i++)
>                       {
>                               String parameterName = parameterNames[i];
>                               final Object param = 
> parameters.get(parameterName);
>                               String value = param instanceof String[] ? 
> ((String[])param)[0] : (String)param;
>                               if (value == null)
>                               {
>                                       value = "";  // <===== THIS LINE RIGHT 
> HERE
>                               }
>                               url.append(urlEncode(value)).append("/");
>                               parameterNamesToAdd.remove(parameterName);
>                       }
>               }
> If the parameter is in the middle, you end up with a URL that looks like:
> foo.com/mypage/param1//param3
> The "//" causes images and CSS to not be found (at least on firefox).
> I fixed this locally by setting the value to "-", and looking for that on the 
> way in.
> foo.com/mypage/param1/-/param3
> I'm not sure if this fix would break anything else, so I'm not sure if I 
> should submit a patch.  One possible issue is if someone is passing '-' as a 
> real value and expects it to be there.  I could make '-' the default and 
> allow someone to change it via API...

-- 
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