fix: add escJs for JS string escaping in onclick attributes, apply to users/templates/notifications
This commit is contained in:
@@ -25,6 +25,11 @@ const U = {
|
||||
return String(s).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"').replace(/'/g,''');
|
||||
},
|
||||
|
||||
escJs(s) {
|
||||
if (!s) return '';
|
||||
return String(s).replace(/\\/g,'\\\\').replace(/'/g,"\\'").replace(/\n/g,'\\n');
|
||||
},
|
||||
|
||||
showAlert(containerId, type, msg) {
|
||||
const ct = document.getElementById(containerId || 'page-content');
|
||||
const el = document.createElement('div');
|
||||
|
||||
Reference in New Issue
Block a user