Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-5310

s:url does not handle equal sign correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.5.30, 6.1.2
    • 6.6.0
    • Core Tags
    • None

    Description

      We discovered a strange case when a URL is passed to s:url. The URL contains an equal sign as part of a parameter value. Example:

      https://www.scitepress.org/PublicationsDetail.aspx?ID=GjTu91suYQI=&t=1

      This URL works in the browser even though the equal sign that is part of the value of the parameter ID has not been replaced with %3D.

      When this URL is passed to an s:url as value then the equal sign disappears. When I put a break point in ComponentTagSupport.doStartTag() I can see that the query string has been split and the component.parameters contains the two parameters (ID and t), but the equal sign is missing. 

      The problem seems to be in ServletUrlRenderer.mergeRequestParameters called from beforeRenderUrl. The way the StrutsQueryStringParser.parse splits each param of the queryString on equal sign causes all the equal signs to be used, not just the first. Shouldn't that split be only on the first equal sign so that any remaining equal signs can be considered as part of the value? Just by adding a limit of one to the split should fix this.

      Attachments

        Activity

          People

            lukaszlenart Lukasz Lenart
            nikos nikos dimitrakas
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 3h
                3h