fix(tracker): add "plus" to email detecting regexp

This commit is contained in:
Nico Prat 2024-03-12 10:32:04 +01:00 committed by GitHub
parent b8eca2516b
commit c4d8a2d2a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -74,7 +74,7 @@ export default class Sanitizer {
data = data.replace(/\d/g, '0')
}
if (this.options.obscureTextEmails) {
data = data.replace(/^\w+([.-]\w+)*@\w+([.-]\w+)*\.\w{2,3}$/g, (email) => {
data = data.replace(/^\w+([+.-]\w+)*@\w+([.-]\w+)*\.\w{2,3}$/g, (email) => {
const [name, domain] = email.split('@')
const [domainName, host] = domain.split('.')
return `${stars(name)}@${stars(domainName)}.${stars(host)}`