Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 7.4
    • Fix Version/s: 8.3-milestone-1
    • Component/s: Old Core
    • Labels:
      None
    • Tests:
      Unit
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      Test proving the problem:

          @Test
          public void createURLWhenCharactersNeedToBeEncoded() throws Exception
          {
              // Note: The query string is not encoded, and used as is. It's the responsibility of the caller to
              // url-encode it.
              // See see http://stackoverflow.com/a/29948396/153102 for a good explanation of URL encoding:
              // - space in path part must be encoded with %20 (and not "+"). "+" character should be left as is.
              // - space in query string part and fragment part can be encoded with "+" or "%20". "+" character should be
              //   encoded with "%2B"
              URL url = this.urlFactory.createURL("a b.c+d", "e f", "view", "g=h+i", "j k+l", this.oldcore.getXWikiContext());
              assertEquals("http://127.0.0.1/xwiki/bin/view/a%20b/c+d/e%20f?g=h+i#j%20k%2Bl", url.toString());
          }
      

      Expected :http://127.0.0.1/xwiki/bin/view/a%20b/c+d/e%20f?g=h+i#j%20k%2Bl
      Actual :http://127.0.0.1/xwiki/bin/view/a+b/c%2Bd/e+f?g=h+i#j+k%2Bl

      Problem it's causing: http://jira.xwiki.org/browse/XWIKI-13556?focusedCommentId=91999&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-91999

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vmassol Vincent Massol
                Reporter:
                vmassol Vincent Massol
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: