Escape safely shell arguments

This commit is contained in:
Paul Nameless 2021-04-24 18:58:16 +03:00
parent 01c755c165
commit f0e002c815

View file

@ -181,8 +181,8 @@ def notify(
notify_cmd = cmd.format( notify_cmd = cmd.format(
icon_path=shlex.quote(config.ICON_PATH), icon_path=shlex.quote(config.ICON_PATH),
title=shlex.quote(title), title=shlex.quote(title),
subtitle=shlex.quote(subtitle), subtitle=shlex.quote(shlex.escape(subtitle)),
msg=shlex.quote(msg.replace("'", "'\\''") + "'"), msg=shlex.quote(shlex.escape(msg)),
) )
subprocess.Popen(notify_cmd, shell=True) subprocess.Popen(notify_cmd, shell=True)