Rework escaping of special characters in message properties for account console (#9995)
Closes #9503
This commit is contained in:
parent
5494848f3f
commit
100dbb8781
3 changed files with 9 additions and 6 deletions
|
@ -168,10 +168,11 @@ public class AccountConsole {
|
|||
}
|
||||
|
||||
private String convertPropValue(String propertyValue) {
|
||||
propertyValue = propertyValue.replace("''", "%27");
|
||||
propertyValue = propertyValue.replace("'", "%27");
|
||||
propertyValue = propertyValue.replace("\"", "%22");
|
||||
|
||||
// this mimics the behavior of java.text.MessageFormat used for the freemarker templates:
|
||||
// To print a single quote one needs to write two single quotes.
|
||||
// Single quotes will be stripped.
|
||||
// Usually single quotes would escape parameters, but this not implemented here.
|
||||
propertyValue = propertyValue.replaceAll("'('?)", "$1");
|
||||
propertyValue = putJavaParamsInNgTranslateFormat(propertyValue);
|
||||
|
||||
return propertyValue;
|
||||
|
|
|
@ -62,7 +62,9 @@
|
|||
|
||||
<#if msg??>
|
||||
var locale = '${locale}';
|
||||
var l18nMsg = JSON.parse('${msgJSON?no_esc}');
|
||||
<#outputformat "JavaScript">
|
||||
var l18nMsg = JSON.parse('${msgJSON?js_string}');
|
||||
</#outputformat>
|
||||
<#else>
|
||||
var locale = 'en';
|
||||
var l18Msg = {};
|
||||
|
|
|
@ -58,7 +58,7 @@ export class Msg extends React.Component<MsgProps> {
|
|||
})
|
||||
}
|
||||
|
||||
return unescape(message);
|
||||
return message;
|
||||
}
|
||||
|
||||
// if the message key has Freemarker syntax, remove it
|
||||
|
|
Loading…
Reference in a new issue