Escape the apprise -b parameter
This commit is contained in:
parent
6f06fccd46
commit
da6964c19a
1 changed files with 1 additions and 1 deletions
|
|
@ -116,7 +116,7 @@ export const notify = html => new Promise((resolve, reject) => {
|
|||
return resolve();
|
||||
}
|
||||
// const cmd = `apprise '${cfg.notify}' ${title} -i html -b '${html}'`; // this had problems if e.g. ' was used in arg; could have `npm i shell-escape`, but instead using safer execFile which takes args as array instead of exec which spawned a shell to execute the command
|
||||
const args = [cfg.notify, '-i', 'html', '-b', html];
|
||||
const args = [cfg.notify, '-i', 'html', '-b', `'${html}'`];
|
||||
if (cfg.notify_title) args.push(...['-t', cfg.notify_title]);
|
||||
if (cfg.debug) console.debug(`apprise ${args.map(a => `'${a}'`).join(' ')}`); // this also doesn't escape, but it's just for info
|
||||
execFile('apprise', args, (error, stdout, stderr) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue