addressing false positive jsverify rngState 8bf7605ea139db4c28
This commit is contained in:
parent
00438ec1ab
commit
bab95cce1b
@ -76,12 +76,12 @@ describe('I18n', function () {
|
|||||||
params[0] = params[0].replace(/%(s|d)/g, '%%');
|
params[0] = params[0].replace(/%(s|d)/g, '%%');
|
||||||
postfix = postfix.replace(/%(s|d)/g, '%%');
|
postfix = postfix.replace(/%(s|d)/g, '%%');
|
||||||
const translation = DOMPurify.sanitize(
|
const translation = DOMPurify.sanitize(
|
||||||
prefix + $.PrivateBin.Helper.htmlEntities(params[0]) + '<a></a>' + postfix, {
|
prefix + '<a href="' + params[0] + '"></a>' + postfix, {
|
||||||
ALLOWED_TAGS: ['a', 'i', 'span'],
|
ALLOWED_TAGS: ['a', 'i', 'span'],
|
||||||
ALLOWED_ATTR: ['href', 'id']
|
ALLOWED_ATTR: ['href', 'id']
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
params.unshift(prefix + '%s<a></a>' + postfix);
|
params.unshift(prefix + '<a href="%s"></a>' + postfix);
|
||||||
const result = $.PrivateBin.I18n.translate.apply(this, params);
|
const result = $.PrivateBin.I18n.translate.apply(this, params);
|
||||||
$.PrivateBin.I18n.reset();
|
$.PrivateBin.I18n.reset();
|
||||||
const alias = $.PrivateBin.I18n._.apply(this, params);
|
const alias = $.PrivateBin.I18n._.apply(this, params);
|
||||||
@ -128,13 +128,13 @@ describe('I18n', function () {
|
|||||||
params[0] = params[0].replace(/%(s|d)/g, '%%').trim();
|
params[0] = params[0].replace(/%(s|d)/g, '%%').trim();
|
||||||
postfix = postfix.replace(/%(s|d)/g, '%%').trim();
|
postfix = postfix.replace(/%(s|d)/g, '%%').trim();
|
||||||
const translation = DOMPurify.sanitize(
|
const translation = DOMPurify.sanitize(
|
||||||
prefix + $.PrivateBin.Helper.htmlEntities(params[0]) + '<a></a>' + postfix, {
|
prefix + '<a href="' + params[0] + '"></a>' + postfix, {
|
||||||
ALLOWED_TAGS: ['a', 'i', 'span'],
|
ALLOWED_TAGS: ['a', 'i', 'span'],
|
||||||
ALLOWED_ATTR: ['href', 'id']
|
ALLOWED_ATTR: ['href', 'id']
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
let args = Array.prototype.slice.call(params);
|
let args = Array.prototype.slice.call(params);
|
||||||
args.unshift(prefix + '%s<a></a>' + postfix);
|
args.unshift(prefix + '<a href="%s"></a>' + postfix);
|
||||||
let clean = jsdom();
|
let clean = jsdom();
|
||||||
$('body').html('<div id="i18n"></div>');
|
$('body').html('<div id="i18n"></div>');
|
||||||
args.unshift($('#i18n'));
|
args.unshift($('#i18n'));
|
||||||
|
Loading…
Reference in New Issue
Block a user