mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2026-04-19 21:58:08 -04:00
revert to regex to address issue discovered by CodeQL
This commit is contained in:
+10
-5
@@ -82,7 +82,8 @@ describe('Helper', function () {
|
|||||||
'ignores non-URL content',
|
'ignores non-URL content',
|
||||||
'string',
|
'string',
|
||||||
function (content) {
|
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();
|
let clean = jsdom();
|
||||||
$('body').html('<div id="foo"></div>');
|
$('body').html('<div id="foo"></div>');
|
||||||
let e = $('#foo');
|
let e = $('#foo');
|
||||||
@@ -100,8 +101,10 @@ describe('Helper', function () {
|
|||||||
jsc.array(common.jscHashString()),
|
jsc.array(common.jscHashString()),
|
||||||
'string',
|
'string',
|
||||||
function (prefix, url, fragment, postfix) {
|
function (prefix, url, fragment, postfix) {
|
||||||
prefix = prefix.replace(/\r|\f/g, '\n').replace('\u0000', '').replace('\u000b', '');
|
// eslint-disable-next-line no-control-regex
|
||||||
postfix = ' ' + postfix.replace('\r', '\n').replace('\u0000', '');
|
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('');
|
url.fragment = fragment.join('');
|
||||||
let urlString = common.urlToString(url),
|
let urlString = common.urlToString(url),
|
||||||
clean = jsdom();
|
clean = jsdom();
|
||||||
@@ -132,8 +135,10 @@ describe('Helper', function () {
|
|||||||
jsc.array(common.jscQueryString()),
|
jsc.array(common.jscQueryString()),
|
||||||
'string',
|
'string',
|
||||||
function (prefix, query, postfix) {
|
function (prefix, query, postfix) {
|
||||||
prefix = prefix.replace(/\r|\f/g, '\n').replace('\u0000', '').replace('\u000b', '');
|
// eslint-disable-next-line no-control-regex
|
||||||
postfix = ' ' + postfix.replace('\r', '\n').replace('\u0000', '');
|
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, ''),
|
let url = 'magnet:?' + query.join('').replace(/^&+|&+$/gm, ''),
|
||||||
clean = jsdom();
|
clean = jsdom();
|
||||||
$('body').html('<div id="foo"></div>');
|
$('body').html('<div id="foo"></div>');
|
||||||
|
|||||||
Reference in New Issue
Block a user