Details

    Description

      Steps to reproduce

      Preparation:

      1. Start the portal
      2. Log in with user
      3. Add a Language and a Tags Navigation portlet on the Welcome page
      4. Configure the Tags Navigation to display unused tags
      5. Add a new tag under Site -> Content -> Tags with a name "a tag" (important: it has to have a space in it)

      Issue 1

      1. In the Tags Navigation, click on a tag, you'll get http://localhost:8080/web/guest/home/-/tag/a+tag
      2. Add de to the URL: http://localhost:8080/de/web/guest/home/-/tag/a+tag
      3. Notice the "Set German (Germany) as your preferred language" link at the top and click on it
      4. Result: You're looking at a blank page with an exception in the log, for example:
        WARNING [http-nio-8080-exec-7] org.apache.catalina.connector.Response.sendRedirect Failed to redirect to [http://localhost:8080/web/guest/home/-/tag/my tag]
         java.lang.IllegalArgumentException: Illegal character in path at index 45: http://localhost:8080/web/guest/home/-/tag/my tag
            at java.net.URI.create(URI.java:852)
            at org.apache.catalina.connector.Response.sendRedirect(Response.java:1280)
            at org.apache.catalina.connector.Response.sendRedirect(Response.java:1252)
            at org.apache.catalina.connector.ResponseFacade.sendRedirect(ResponseFacade.java:500)
            at javax.servlet.http.HttpServletResponseWrapper.sendRedirect(HttpServletResponseWrapper.java:138)
            at javax.servlet.http.HttpServletResponseWrapper.sendRedirect(HttpServletResponseWrapper.java:138)
            at javax.servlet.http.HttpServletResponseWrapper.sendRedirect(HttpServletResponseWrapper.java:138)
            at com.liferay.portal.servlet.filters.absoluteredirects.AbsoluteRedirectsResponse.sendRedirect(AbsoluteRedirectsResponse.java:46)
            at javax.servlet.http.HttpServletResponseWrapper.sendRedirect(HttpServletResponseWrapper.java:138)
            at javax.servlet.http.HttpServletResponseWrapper.sendRedirect(HttpServletResponseWrapper.java:138)
            at com.liferay.portal.kernel.servlet.MetaInfoCacheServletResponse.sendRedirect(MetaInfoCacheServletResponse.java:424)
            at com.liferay.portal.action.UpdateLanguageAction.execute(UpdateLanguageAction.java:143)
            at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
        (...)
        Caused by: java.net.URISyntaxException: Illegal character in path at index 45: http://localhost:8080/web/guest/home/-/tag/my tag
            at java.net.URI$Parser.fail(URI.java:2848)
            at java.net.URI$Parser.checkChars(URI.java:3021)
            at java.net.URI$Parser.parseHierarchical(URI.java:3105)
            at java.net.URI$Parser.parse(URI.java:3053)
            at java.net.URI.<init>(URI.java:588)
            at java.net.URI.create(URI.java:850)
            ... 123 more
        

      Issue 2

      1. Go the Welcome page and click on the USA flag in the language portlet
      2. Go to http://localhost:8080/de/web/guest/home?param1=something%26paramparam=something
      3. Click on the "Set German (Germany) as your preferred language"
        Expected result: You're taken to /web/guest/home?param1=something%26paramparam=something
        Actual result: You're taken to /web/guest/home?param1=something*&*paramparam=something

      Meaning: The percent-encoded ampersand gets de-coded, meaning, the original value of "param1" has changed

      Technical Notes: The root cause of Issue 1 and Issue 2 is the same, the redirect is not encoded properly

      Attachments

        Issue Links

          Activity

            People

              hong.zhao Hong Zhao (Inactive)
              amadea.fejes Amadea Fejes (Inactive)
              Kiyoshi Lee Kiyoshi Lee
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                5 years, 31 weeks, 6 days ago

                Packages

                  Version Package
                  7.0.0 DXP FP28
                  7.0.X EE
                  7.0.4 CE GA5
                  7.1.X
                  Master