Re: [PATCH v6] gitweb: redacted e-mail addresses feature.
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 8, 2021, 22:51 UTC
- Message-ID
- <xmqqblaoqtjf.fsf@gitster.g>
- In-Reply-To
- <87eefkieig.fsf@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 8 quoted lines
>> +sub hide_mailaddrs_if_private {
>> + my $line = shift;
>> + return $line unless gitweb_check_feature('email-privacy');
>> + $line =~ s/<[^@>]+@[^>]+>/<redacted>/ig;
>
> The /i here is redundant, since you have nothing that'll case-fold on
> the LHS of the s///, doesn't harm anything either. Just a small note
> since it's new in v6...True. If it were left original version that was suggested during the review, e.g.
s/<[^@]+@[-.a-z0-9]+>/<red@cted>/ig;
the /i/ would have been needed, but without the "after the @-sign should be a run of DNS-valid characters", I agree that there is no need.
Thanks. Will locally tweak.