query string decoding error in URLHelper.parseQueryString
---------------------------------------------------------

                 Key: WW-3411
                 URL: https://issues.apache.org/jira/browse/WW-3411
             Project: Struts 2
          Issue Type: Bug
    Affects Versions: 2.1.8.1
            Reporter: Sean Ford
         Attachments: URLHelper_parseQueryString_EncodingFix.patch

There is a bug in URLHelper.parseQueryString() when dealing with keys in a 
query string that are URL Encoded.

Example: 
UrlHelper.parseQueryString("a%3Ca=1") returns a map {"a%3Ca" : "1"}. Note, the 
key is still URL Encoded.

The problem becomes apparent if you use <s:url> with includeParams="all", which 
will grab parameters from both the query string and request parameterMap to 
include into a URL.

Example:
Request URL:  /myAction.action?a<a=1
Generated URL by <s:url>: /myAction.action?a<a=1&amp;a%3Ca=1
Expected URL: /myAction.action?a%3Ca=1

Note how "a<a" exists two times in the <s:url> URL, one encoded and one 
decoded. "a<a" is grabbed from the parameterMap where the servlet container 
will automatically decode the key. "a%3Ca" is grabbed from the query string by 
the UrlHelper.parseQueryString (who doesn't decode the key).

The fix is relatively simple (see patch)... I think parseQueryString just needs 
to call translatedAndDecode on the parameter name.

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