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

Problem with escape when the key from getText has no value

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.5.8, 2.5.10
    • 6.0.0
    • Core Tags
    • None

    Description

      When using an encoding like ISO-8859-1 and having the following situation:

      message.ftl
      ...
      <@s.text name="Obrigatório - not mapped word in any dictionary" />
      ...
      

      We have the following output after update 2.5.8:

      Obrigat\u00F3rio - not mapped word in any dictionary
      

      After careful look at the source code and issues from the 2.5.8 I found the problem happens just in one added line on WW-4712, the following part of the code:

      TextProviderHelper.java
      ...
      public static String getText(String key, String defaultMessage, List<Object> args, ValueStack stack, boolean searchStack) {
      ...
      //This escape causes the problem
      msg = StringEscapeUtils.escapeEcmaScript(msg);
      ...
      }
      ...
      

      Attachments

        Issue Links

          Activity

            People

              lukaszlenart Lukasz Lenart
              mtsbarbosa Mateus Carvalho
              Votes:
              0 Vote for this issue
              Watchers:
              6 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 - 50m
                  50m