Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-9475

Move call "request.setCharacterEncoding(StringPool.UTF8);" to BasePortalFilter

    Details

    • Type: Feature Request
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 5.1.2, 5.2.3, 6.0.1 RC
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Glassfish v2.1 related issue LEP-2926
    • Branch Version/s:
      5.2.x
    • Backported to Branch:
      Committed

      Description

      Envirionment Glassfish.

      When creating custom filter to Liferay on ext envronment by extending BasePortalFilter. If this custom filter has been added as be executed on first on Liferay then it will cause character encoding problems on special characters if request.getParameter() has been called on filter. See also related issue LEP-2926, where solution is not complete on my point of view.

      On custom filter this can be fixed by putting following on filter.

      request.setCharacterEncoding(StringPool.UTF8);

      But this then cause VirtualHostFilter filter request.setCharacterEncoding(StringPool.UTF8) call to be complain.

      Which further ca be fixed on ext by fixing Virtual host filter.

      By changing

      request.setCharacterEncoding(StringPool.UTF8);

      to

      if (!StringPool.UTF8.equals(request.getCharacterEncoding()))

      { request.setCharacterEncoding(StringPool.UTF8); }

      SOLUTION:

      I would suggest that this request.setCharacterEncoding(StringPool.UTF8) would be moved on BasePortalFilter level so ext users would not have run on unnecessary problems while using it.

        Attachments

          Activity

            People

            • Assignee:
              support-lep@liferay.com SE Support
              Reporter:
              sampsa Sampsa Sohlman (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: