From ac79db5f6699e8ca389d00aac45713d2150bdddd Mon Sep 17 00:00:00 2001 From: Paul Wilde Date: Mon, 16 Aug 2021 20:39:21 +0100 Subject: [PATCH] corrected incorrect regex --- src/.htaccess | 4 ---- src/web/responses/responses.go | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) delete mode 100644 src/.htaccess diff --git a/src/.htaccess b/src/.htaccess deleted file mode 100644 index 36b5b0b..0000000 --- a/src/.htaccess +++ /dev/null @@ -1,4 +0,0 @@ -RewriteEngine on -RewriteCond %{REQUEST_FILENAME} !-f -RewriteCond %{REQUEST_FILENAME} !-d -RewriteRule ^(.*)$ /index.php?path=$1 [NC,L,QSA] diff --git a/src/web/responses/responses.go b/src/web/responses/responses.go index d0cc973..5422c64 100644 --- a/src/web/responses/responses.go +++ b/src/web/responses/responses.go @@ -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 }