]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
view: addr2urlmap matches HTML-escaped addresses, only
authorEric Wong <e@80x24.org>
Fri, 13 Sep 2024 22:07:22 +0000 (22:07 +0000)
committerEric Wong <e@80x24.org>
Sat, 14 Sep 2024 21:07:40 +0000 (21:07 +0000)
Some odd email addresses may require HTML escaping, and
the resulting regexp is run on escaped HTML.

lib/PublicInbox/View.pm

index 37c910f85244e99f8e1f435b5f8c4d399edad9ac..19f4168edc6978aa767fa3e53ee1cfcedbb34de8 100644 (file)
@@ -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: