mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-11-29 18:46:53 -05:00
revert to regex to address issue discovered by CodeQL
This commit is contained in:
parent
e35894e4f8
commit
5ae2ebcc77
1 changed files with 10 additions and 5 deletions
|
|
@ -82,7 +82,8 @@ describe('Helper', function () {
|
|||
'ignores non-URL content',
|
||||
'string',
|
||||
function (content) {
|
||||
content = content.replace(/\r|\f/g, '\n').replace('\u0000', '').replace('\u000b', '');
|
||||
// eslint-disable-next-line no-control-regex
|
||||
content = content.replace(/\r|\f/g, '\n').replace(/\u0000/g, '').replace(/\u000b/g, '');
|
||||
let clean = jsdom();
|
||||
$('body').html('<div id="foo"></div>');
|
||||
let e = $('#foo');
|
||||
|
|
@ -100,8 +101,10 @@ describe('Helper', function () {
|
|||
jsc.array(common.jscHashString()),
|
||||
'string',
|
||||
function (prefix, url, fragment, postfix) {
|
||||
prefix = prefix.replace(/\r|\f/g, '\n').replace('\u0000', '').replace('\u000b', '');
|
||||
postfix = ' ' + postfix.replace('\r', '\n').replace('\u0000', '');
|
||||
// eslint-disable-next-line no-control-regex
|
||||
prefix = prefix.replace(/\r|\f/g, '\n').replace(/\u0000/g, '').replace(/\u000b/g, '');
|
||||
// eslint-disable-next-line no-control-regex
|
||||
postfix = ' ' + postfix.replace(/\r/g, '\n').replace(/\u0000/g, '');
|
||||
url.fragment = fragment.join('');
|
||||
let urlString = common.urlToString(url),
|
||||
clean = jsdom();
|
||||
|
|
@ -132,8 +135,10 @@ describe('Helper', function () {
|
|||
jsc.array(common.jscQueryString()),
|
||||
'string',
|
||||
function (prefix, query, postfix) {
|
||||
prefix = prefix.replace(/\r|\f/g, '\n').replace('\u0000', '').replace('\u000b', '');
|
||||
postfix = ' ' + postfix.replace('\r', '\n').replace('\u0000', '');
|
||||
// eslint-disable-next-line no-control-regex
|
||||
prefix = prefix.replace(/\r|\f/g, '\n').replace(/\u0000/g, '').replace(/\u000b/g, '');
|
||||
// eslint-disable-next-line no-control-regex
|
||||
postfix = ' ' + postfix.replace(/\r/g, '\n').replace(/\u0000/g, '');
|
||||
let url = 'magnet:?' + query.join('').replace(/^&+|&+$/gm, ''),
|
||||
clean = jsdom();
|
||||
$('body').html('<div id="foo"></div>');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue