From 7fe2785887b59355bb0c57c16804d5b02b042b77 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 20 May 2026 09:02:13 +0200 Subject: [PATCH] mod/notification-telegram: use :convert for url-encoding --- mod/notification-telegram.rsc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mod/notification-telegram.rsc b/mod/notification-telegram.rsc index f3fa6f84..0d0fd6e9 100644 --- a/mod/notification-telegram.rsc +++ b/mod/notification-telegram.rsc @@ -126,7 +126,6 @@ :global LogPrint; :global ProtocolStrip; :global SymbolForNotification; - :global UrlEncode; :local EscapeMD do={ :local Text [ :tostr $1 ]; @@ -203,7 +202,7 @@ } :local Data ([ /tool/fetch check-certificate=yes-without-crl output=user http-method=post \ ("https://api.telegram.org/bot" . $TokenId . "/sendMessage") \ - http-data=($HTTPData . "&text=" . [ $UrlEncode $Text ]) as-value ]->"data"); + http-data=($HTTPData . "&text=" . [ :convert to=url $Text ]) as-value ]->"data"); :set ($TelegramMessageIDs->[ :tostr ([ :deserialize from=json value=$Data ]->"result"->"message_id") ]) 1; } do={ $LogPrint info $0 ("Failed sending Telegram notification: " . $Err . " - Queuing..."); @@ -215,7 +214,7 @@ [ $EscapeMD ("This message was queued since _" . [ /system/clock/get date ] . \ " " . [ /system/clock/get time ] . "_ and may be obsolete.") "plain" "_" ]); :set ($TelegramQueue->[ :len $TelegramQueue ]) { tokenid=$TokenId; - http-data=($HTTPData . "&text=" . [ $UrlEncode $Text ]) }; + http-data=($HTTPData . "&text=" . [ :convert to=url $Text ]) }; :if ([ :len [ /system/scheduler/find where name="_FlushTelegramQueue" ] ] = 0) do={ /system/scheduler/add name="_FlushTelegramQueue" interval=1m start-time=startup \ on-event=(":global FlushTelegramQueue; \$FlushTelegramQueue;");