From f0e002c815ff9fa14fb034d352918ceb2723b3fd Mon Sep 17 00:00:00 2001 From: Paul Nameless Date: Sat, 24 Apr 2021 18:58:16 +0300 Subject: [PATCH] Escape safely shell arguments --- tg/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tg/utils.py b/tg/utils.py index dd67095..57ce1de 100644 --- a/tg/utils.py +++ b/tg/utils.py @@ -181,8 +181,8 @@ def notify( notify_cmd = cmd.format( icon_path=shlex.quote(config.ICON_PATH), title=shlex.quote(title), - subtitle=shlex.quote(subtitle), - msg=shlex.quote(msg.replace("'", "'\\''") + "'"), + subtitle=shlex.quote(shlex.escape(subtitle)), + msg=shlex.quote(shlex.escape(msg)), ) subprocess.Popen(notify_cmd, shell=True)