From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NO_DNS_FOR_FROM,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from kanazawa.. (unknown [101.128.126.198]) by gnuweeb.org (Postfix) with ESMTPSA id 2DD057E245; Fri, 4 Nov 2022 18:09:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1667585390; bh=gtcbNXb+IPE/tnkFSzjI/qwHzLTCn/f9oUM6nlnb3wA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rkWWUZJTQUyNxQT/5dw3p8FbcGAU3kJq2g5RfGQoPKUJIe6dT8MvF78wmZRdilYvI amLDu8NAjHZ55oQCpjHeaJgsGYIOM0QyEoaZM76t5c+Kx+1CFl4PAzKYdQk0+uPbG9 c3v7RLE1E75ZC4Kn09lP2Y1IM2DMZjmairjC1rlxmAePXckyk4PKqy28eSMl8a6G7x UgCBh/T5fTRBgnLoiRScGF6NgwS1QypGJXpHsnTcybU+xXiXSYMvBO3kL2yx/WZAVu NfY01wrpCcSA+v5Y8POdNlfKZ06J2BgviceFyakUNhPd5Cv8DOngpeJbgDB1mYP9+5 MVCHyrtYCqGCg== From: Muhammad Rizki To: Ammar Faizi Cc: Muhammad Rizki , Alviro Iskandar Setiawan , GNU/Weeb Mailing List Subject: [PATCH v1 05/16] utils: Improve fix_utf8_char() Date: Sat, 5 Nov 2022 01:09:12 +0700 Message-Id: <20221104180931.3852-6-kiizuha@gnuweeb.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221104180931.3852-1-kiizuha@gnuweeb.org> References: <20221104180931.3852-1-kiizuha@gnuweeb.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: Improvement for the fix_utf8_char() to ensure the `>` will be unescaped, because if not use the html.unescape(), the email payload will contain `>` for the Discord bot. Signed-off-by: Muhammad Rizki --- daemon/atom/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/daemon/atom/utils.py b/daemon/atom/utils.py index 15679d2..fe3f8d2 100644 --- a/daemon/atom/utils.py +++ b/daemon/atom/utils.py @@ -263,8 +263,8 @@ def remove_patch(tmp: Union[str, list]): def fix_utf8_char(text: str, html_escape: bool = True): t = text.rstrip().replace("�"," ") if html_escape: - t = html.escape(html.escape(text)) - return t + return html.escape(html.escape(text)) + return html.unescape(t) def get_decoded_payload(payload: Message): -- Muhammad Rizki