corrected incorrect regex

This commit is contained in:
Paul Wilde 2021-08-16 20:39:21 +01:00
parent 0064740c13
commit ac79db5f66
2 changed files with 2 additions and 6 deletions

View file

@ -1,4 +0,0 @@
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?path=$1 [NC,L,QSA]

View file

@ -85,13 +85,13 @@ func parseUsername(svc Service) string {
if svc.UsernameIsFQDN && !svc.RequireLocalDomain{
return email
} else if svc.UsernameIsFQDN && svc.RequireLocalDomain {
re := regexp.MustCompile(`[^@]+$`)
re := regexp.MustCompile(`[^@(%40)]+$`)
domain := re.FindString(email)
localemail := strings.Replace(email, domain,
global.MainConfig.LocalDomain,1)
return localemail
} else {
re := regexp.MustCompile(`^[^@]+`)
re := regexp.MustCompile(`^[^@(%40)]+`)
username := re.FindString(email)
return username
}