Details
-
Bug
-
Resolution: Fixed
-
Major
-
7.4
-
None
-
Unit
-
Unknown
-
N/A
-
N/A
-
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
- relates to
-
XCOMMONS-1054 Escape Tool should not encode space as + in URL paths
- Closed
-
XWIKI-13556 XWiki fails to work with Tomcat 7.0.69+ and 8.0.33+
- Closed