Skip to content

Commit 86380d9

Browse files
authored
Allow specific special characters (#823)
1 parent 9123974 commit 86380d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

route/v1/samba.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@ func PostSambaConnectionsCreate(c *gin.Context) {
131131
return
132132
}
133133

134-
if ok, _ := regexp.MatchString("^[a-zA-Z0-9]{4,30}$", connection.Password); !ok {
134+
if ok, _ := regexp.MatchString(`^[\w@#*.]{4,30}$`, connection.Password); !ok {
135135
c.JSON(common_err.CLIENT_ERROR, model.Result{Success: common_err.CHARACTER_LIMIT, Message: common_err.GetMsg(common_err.CHARACTER_LIMIT)})
136136
return
137137
}
138-
if ok, _ := regexp.MatchString("^[a-zA-Z0-9]{4,30}$", connection.Username); !ok {
138+
if ok, _ := regexp.MatchString(`^[\w@#*.]{4,30}$`, connection.Username); !ok {
139139
c.JSON(common_err.CLIENT_ERROR, model.Result{Success: common_err.INVALID_PARAMS, Message: common_err.GetMsg(common_err.INVALID_PARAMS)})
140140
return
141141
}

0 commit comments

Comments
 (0)