ImportHandler: Use JSON.stringify() to properly escape characters

This commit is contained in:
Richard Hansen 2021-02-07 19:38:14 -05:00 committed by John McLear
parent ed80883709
commit 26b5a69ccc
2 changed files with 1 additions and 2 deletions

View file

@ -276,7 +276,7 @@ exports.doImport = (req, res, padId) => {
'<script>',
"document.addEventListener('DOMContentLoaded', () => {",
' window.parent.padimpexp.handleFrameCall(',
` '${req.directDatabaseAccess}', '${status}');`,
` ${JSON.stringify(!!req.directDatabaseAccess)}, ${JSON.stringify(status)});`,
'});',
'</script>',
].join('\n'));

View file

@ -171,7 +171,6 @@ const padimpexp = (() => {
$('.disabledexport').click(cantExport);
},
handleFrameCall: (directDatabaseAccess, status) => {
if (directDatabaseAccess === 'undefined') directDatabaseAccess = false;
if (status !== 'ok') {
importErrorMessage(status);
} else {