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.
There is a $20.00 for this service.
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.
Attachments
Issue Links
- relates to
-
HSTTWO-3367 Backport to 7.9: hst:messagesReplace tag doesn't replace dollar sign prefixed variable expression
- Closed