From 405a8005e01d5e5dea8ffd5c5cbecd544f141e1e Mon Sep 17 00:00:00 2001 From: khuxkm fbexl Date: Tue, 23 Jun 2020 15:28:00 -0400 Subject: [PATCH] Instead of doing fancy lstrip or brutalist slicing, just urlencode the entire channel name --- gen_stats | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gen_stats b/gen_stats index 456a311..98c4ef6 100755 --- a/gen_stats +++ b/gen_stats @@ -1,6 +1,7 @@ #!/usr/bin/env python3 import requests, json import xml.etree.ElementTree as xml +from urllib.parse import quote WORK_DIR = "/var/www/tilde.chat" r = requests.get("http://localhost:8081/stats") @@ -41,7 +42,7 @@ for schannel in schannels: ): continue - channel["webchatlink"] = "https://web.tilde.chat/?join=" + channel["name"][1:] + channel["webchatlink"] = "https://web.tilde.chat/?join=" + quote(channel["name"]) channels.append(channel)