Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--web/service/inbound.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/web/service/inbound.go b/web/service/inbound.go
index 5213fce6..822a4e8d 100644
--- a/web/service/inbound.go
+++ b/web/service/inbound.go
@@ -2024,6 +2024,7 @@ func (s *InboundService) GetOnlineClients() []string {
}
func validateEmail(email string) (bool, error) {
+
if strings.Contains(email, " ") {
return false, errors.New("email contains spaces, please remove them")
}
@@ -2032,6 +2033,11 @@ func validateEmail(email string) (bool, error) {
return false, errors.New("email contains uppercase letters, please convert to lowercase")
}
+ nonEnglishPattern := `[^\x00-\x7F]`
+ if regexp.MustCompile(nonEnglishPattern).MatchString(email) {
+ return false, errors.New("email contains non-English characters, please use only English")
+ }
+
emailPattern := `^[a-z0-9@._-]+$`
if !regexp.MustCompile(emailPattern).MatchString(email) {
return false, errors.New("email contains invalid characters, please use only lowercase letters, digits, and @._-")