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

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.5.8, 2.5.10
    • Fix Version/s: 2.6
    • Component/s: Core Tags
    • Labels:
      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

              • Assignee:
                lukaszlenart Lukasz Lenart
                Reporter:
                mtsbarbosa Mateus Carvalho
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated: