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=-1.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,NO_DNS_FOR_FROM, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from [192.168.1.2] (unknown [101.128.125.123]) by gnuweeb.org (Postfix) with ESMTPSA id 96C3180908; Fri, 21 Oct 2022 08:25:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1666340713; bh=7cMlfCk4JVb1pPOqGaKQKE3O9VthhzQUgNkPCCpqYRk=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Hyn0V0++R/b0G4qsRmIrHzkuaDHXTuwbBw/TKBX6w16fAejvz9ZDBhhlEGKRYoJky 2MKednIAHxLmDY7yCyODanzersh0UK77syyNki7HWhsX2XMOTgHh+CMOfSBRyLX75A CODLCi2EOOKob5RBj9UBmon2YPpgwksU3od4pf+IWelvBT3Y84NaJV70eI3bscDVsU kmGtoVRdtJq9ppjsa3giKUHznERq6eacwKhvpQn/BnmAkKvLWEnrvIsg7LjGsiS3h+ SakIYK6URwMTbuCnq9TibI0+I1lQMZW3A63YvR/yJpgM8X1QWbpzu96VnB1hsLOcNC 6kipC6pnhk9+A== Message-ID: Date: Fri, 21 Oct 2022 15:25:09 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH v2 4/8] atom: Small change for fix_utf8_char() Content-Language: en-US To: Ammar Faizi Cc: Alviro Iskandar Setiawan , GNU/Weeb Mailing List References: <20221020083845.907-1-kiizuha@gnuweeb.org> <20221020083845.907-5-kiizuha@gnuweeb.org> From: Muhammad Rizki In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: On 21/10/2022 13.53, Ammar Faizi wrote: > On 10/20/22 3:38 PM, Muhammad Rizki wrote: >> Change the parameter to unescape with boolean type and change from >> html.escape to html.unescape for the Discord bot. >> >> Signed-off-by: Muhammad Rizki >> --- >>   daemon/atom/utils.py | 8 ++++---- >>   1 file changed, 4 insertions(+), 4 deletions(-) >> >> diff --git a/daemon/atom/utils.py b/daemon/atom/utils.py >> index a30d5cb..c95612e 100644 >> --- a/daemon/atom/utils.py >> +++ b/daemon/atom/utils.py >> @@ -206,7 +206,7 @@ def create_template(thread: Message, platform: >> str, to=None, cc=None): >>           if len(ret) >= substr: >>               ret = ret[:substr] + "..." >> -        ret = fix_utf8_char(ret, platform == "telegram") >> +        ret = fix_utf8_char(ret, platform == "discord") >>           ret += border >>       return ret, files, is_patch >> @@ -242,10 +242,10 @@ def remove_patch(tmp): >>       shutil.rmtree(tmp) >> -def fix_utf8_char(text: str, html_escape: bool = True): >> +def fix_utf8_char(text: str, unescape: bool = True): >>       t = text.rstrip().replace("�"," ") >> -    if html_escape: >> -        t = html.escape(html.escape(text)) >> +    if unescape: >> +        t = html.unescape(html.unescape(text)) >>       return t > > This is broken. > > I tested this series, but didn't have time to bisect it. After I > managed to bisect the issue, I found that the issue is introduced > by this patch. > > See before and after below, anything inside the angle brackets is > gone. The sample is using this email: > > https://lore.kernel.org/io-uring/f905c8cb-702f-6b2c-8954-1a736feb1ee7@kernel.dk/raw > > ------------- > Before this patch: > > #ml > From: Jens Axboe > To: Ammar Faizi > To: Dylan Yudaken > Cc: Pavel Begunkov > Cc: GNU/Weeb Mailing List > Cc: io-uring Mailing List > Cc: Facebook Kernel Team > Cc: Dylan Yudaken > > ------------- > After this patch: > > #ml > From: Jens Axboe > To: Ammar Faizi > To: Dylan Yudaken > Cc: Pavel Begunkov > Cc: GNU/Weeb Mailing List > Cc: io-uring Mailing List > Cc: Facebook Kernel Team > Cc: Dylan Yudaken > What about this? can you explain what happened? Because I tested it and it has payload.