From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id C4B531F5CB for ; Fri, 13 Sep 2024 22:07:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1726265244; bh=YWWinY3UWukaTtTdXm6L9Ej+R79z9nXcayw41ayxwfY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ZPLYSI+5uxliQDseBsvzF4MY2a9IThLNtQd6KC9jjvLXZSAd9Yw2G3goj3X2CyRTX errM3gKP+saJrAmQPvKFAXsDJYjS7HYL7K/LMlnrT8Zx8UXJ3H8lzbSw5o0T13ZBoc YYhrrSZ4nad5O1pvFfPiW+v6UH8Ithx+DbtHjY3o= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/3] view: addr2urlmap matches HTML-escaped addresses, only Date: Fri, 13 Sep 2024 22:07:22 +0000 Message-ID: <20240913220724.2958606-2-e@80x24.org> In-Reply-To: <20240913220724.2958606-1-e@80x24.org> References: <20240913220724.2958606-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Some odd email addresses may require HTML escaping, and the resulting regexp is run on escaped HTML. --- lib/PublicInbox/View.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 37c910f8..19f4168e 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -196,7 +196,8 @@ sub addr2urlmap ($) { my (%addr2url, $url); while (my ($addr, $ibx) = each %$by_addr) { $url = $ibx->base_url // $ibx->base_url($ctx->{env}); - $addr2url{$addr} = ascii_html($url) if defined $url; + $addr2url{ascii_html($addr)} = ascii_html($url) if + defined $url; } # don't allow attackers to randomly change Host: headers # and OOM us if the server handles all hostnames: