mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-02 02:21:14 +01:00
fix: guard against directional override characters in translator args
This commit is contained in:
@@ -260,7 +260,7 @@ module.exports = function (utils, load, warn) {
|
||||
return Promise.all(argsToTranslate).then(function (translatedArgs) {
|
||||
let out = translated;
|
||||
translatedArgs.forEach(function (arg, i) {
|
||||
let escaped = arg.replace(/%(?=\d)/g, '%').replace(/\\,/g, ',');
|
||||
let escaped = `<bdi>${arg.replace(/%(?=\d)/g, '%').replace(/\\,/g, ',')}</bdi>`;
|
||||
// fix double escaped translation keys, see https://github.com/NodeBB/NodeBB/issues/9206
|
||||
escaped = escaped.replace(/&lsqb;/g, '[')
|
||||
.replace(/&rsqb;/g, ']');
|
||||
|
||||
Reference in New Issue
Block a user