Uploaded image for project: '[Read Only] - Hippo Site Toolkit 2'
  1. [Read Only] - Hippo Site Toolkit 2
  2. HSTTWO-3366

hst:messagesReplace tag doesn't replace dollar sign prefixed variable expression

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • 2.28.12
    • 3.0.1, 3.1.0
    • None
    • None

    Description

      If I use the following with the tag or functions when 'amount' is set to "20.00" in resource bundle document,

      There is a $${amount} for this service.
      

      ,

      it is not interpolated properly against most user's expection.

      Expected
      There is a $20.00 for this service.
      
      Result
      There is a ${amount} for this service.
      

      It is because we're using the dollar sign as escape character by default. (So, from POV of StrSubstitutor, it's working fine as designed though.)
      In order to circumvent this issue, we'd better do the following:

      • Allow to customize variable prefix, suffix and escape character in both tag and functions (for example, by exposing optional attributes or parameters).
      • Use '\' (back-slash) as the default escape character.

      See [1] for detail on what escape character was intended for in commons-lang's StrSubstitutor utility.

      [1] http://markmail.org/message/gxkw7dydydf73kic

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              wko Woonsan Ko (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: