Skip to content

Commit

Permalink
Allow specific special characters (IceWhaleTech#823)
Browse files Browse the repository at this point in the history
  • Loading branch information
LinkLeong authored Jan 16, 2023
1 parent 9123974 commit 86380d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions route/v1/samba.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ func PostSambaConnectionsCreate(c *gin.Context) {
return
}

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

0 comments on commit 86380d9

Please sign in to comment.