From 27133e3cf98cd957d47fc65630e478e51f0896c9 Mon Sep 17 00:00:00 2001 From: anten-ka Date: Fri, 20 Mar 2026 18:49:07 +0300 Subject: [PATCH] Fix: escape client names in bot JSON keyboard to prevent malformed JSON Made-with: Cursor --- warp.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/warp.sh b/warp.sh index da1422b..87beda8 100644 --- a/warp.sh +++ b/warp.sh @@ -1401,8 +1401,9 @@ bot_handle_callback() { label="☐ ${label}" fi t+="\n" + local safe_label; safe_label=$(echo "$label" | sed 's/["\\]/\\&/g; s/\n//g') [ "$first" -eq 0 ] && kbd+="," - kbd+="[{\"text\":\"${label}\",\"callback_data\":\"ct:${i}\"}]" + kbd+="[{\"text\":\"${safe_label}\",\"callback_data\":\"ct:${i}\"}]" first=0 done kbd+=",[{\"text\":\"✅ Все\",\"callback_data\":\"ct:all\"},{\"text\":\"☐ Никого\",\"callback_data\":\"ct:none\"}]"