Uploaded image for project: 'Hippo Site Toolkit 2'
  1. Hippo Site Toolkit 2
  2. HSTTWO-3366

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 2.28.12
    • Fix Version/s: 3.0.1, 3.1.0
    • Component/s: None
    • Labels:
      None
    • Similar issues:

      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

              • Assignee:
                Unassigned
                Reporter:
                wko Woonsan Ko
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: