Skip to content

Commit

Permalink
Use parse instead of parseJSON.
Browse files Browse the repository at this point in the history
  • Loading branch information
SamTV12345 committed Aug 8, 2023
1 parent a096f1a commit 310f1b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/static/js/admin/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const isJSONClean = (data) => {
// this is a bit naive. In theory some key/value might contain the sequences ',]' or ',}'
cleanSettings = cleanSettings.replace(',]', ']').replace(',}', '}');
try {
return typeof JSON.parseJSON(cleanSettings) === 'object';
return typeof JSON.parse(cleanSettings) === 'object';
} catch (e) {
return false; // the JSON failed to be parsed
}
Expand Down
2 changes: 1 addition & 1 deletion src/static/js/vendors/farbtastic.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ $._farbtastic = function (container, options) {
fb.linkTo = function (callback) {
// Unbind previous nodes
if (typeof fb.callback == 'object') {
$(fb.callback).off('keyup').on('keyup').on('keyup', fb.updateValue);
$(fb.callback).off('keyup').on('keyup', fb.updateValue);

Check warning

Code scanning / CodeQL

Unsafe jQuery plugin Medium

Potential XSS vulnerability in the
'$.fn.farbtastic' plugin
.
}

// Reset color
Expand Down

0 comments on commit 310f1b0

Please sign in to comment.