From 403a3773742b7921672b34e96c0d256e7be4b11a Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 18 Dec 2024 23:38:40 +0300 Subject: [PATCH] escape commits for shell --- src/updatenotif.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/updatenotif.py b/src/updatenotif.py index 50bbedd..5b85642 100644 --- a/src/updatenotif.py +++ b/src/updatenotif.py @@ -1,6 +1,7 @@ from loguru import logger import os import asyncio +import shlex async def git_notifications_update(): @@ -18,6 +19,7 @@ async def git_notifications_update(): if len(commits) <= 5: logger.info('updates not found, nothing to do') else: + commits = shlex.quote(commits) os.system( f"termux-notification -i ub4tgupd --title 'ub4tg: update avalaible!' --content 'For apply tap button Get update and restart bot\nChanges:\n{commits}' --button1 'Get update' --button1-action 'termux-notification-remove ub4tgupd; cd {cwd}; git pull && termux-toast 'ub4tg updated, now restart it for apply update' || termux-toast 'ub4tg update failed'") else: