Fix AKA usernames that cannot be disabled
This commit is contained in:
parent
b0c4eb24e5
commit
5fd38f4595
|
@ -50,7 +50,7 @@ func UsersSelfFavouriteModeGET(md common.MethodData) common.CodeMessager {
|
|||
}
|
||||
|
||||
type userSettingsData struct {
|
||||
UsernameAKA string `json:"username_aka"`
|
||||
UsernameAKA *string `json:"username_aka"`
|
||||
FavouriteMode *int `json:"favourite_mode"`
|
||||
CustomBadge struct {
|
||||
singleBadge
|
||||
|
@ -65,7 +65,7 @@ func UsersSelfSettingsPOST(md common.MethodData) common.CodeMessager {
|
|||
md.RequestData.Unmarshal(&d)
|
||||
|
||||
// input sanitisation
|
||||
d.UsernameAKA = common.SanitiseString(d.UsernameAKA)
|
||||
*d.UsernameAKA = common.SanitiseString(*d.UsernameAKA)
|
||||
if md.User.UserPrivileges&common.UserPrivilegeDonor > 0 {
|
||||
d.CustomBadge.Name = common.SanitiseString(d.CustomBadge.Name)
|
||||
d.CustomBadge.Icon = sanitiseIconName(d.CustomBadge.Icon)
|
||||
|
|
Loading…
Reference in New Issue
Block a user