mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[bugfix] Allow instance thumbnail description to be set separately from image (#1417)
This commit is contained in:
@ -178,19 +178,17 @@ func validateInstanceUpdate(form *apimodel.InstanceSettingsUpdateRequest) error
|
||||
return errors.New("empty form submitted")
|
||||
}
|
||||
|
||||
maxImageSize := config.GetMediaImageMaxSize()
|
||||
maxDescriptionChars := config.GetMediaDescriptionMaxChars()
|
||||
|
||||
// validate avatar if present
|
||||
if form.Avatar != nil {
|
||||
maxImageSize := config.GetMediaImageMaxSize()
|
||||
if size := form.Avatar.Size; size > int64(maxImageSize) {
|
||||
return fmt.Errorf("file size limit exceeded: limit is %d bytes but desired instance avatar was %d bytes", maxImageSize, size)
|
||||
}
|
||||
}
|
||||
|
||||
if form.AvatarDescription != nil {
|
||||
if length := len([]rune(*form.AvatarDescription)); length > maxDescriptionChars {
|
||||
return fmt.Errorf("avatar description length must be less than %d characters (inclusive), but provided avatar description was %d chars", maxDescriptionChars, length)
|
||||
}
|
||||
if form.AvatarDescription != nil {
|
||||
maxDescriptionChars := config.GetMediaDescriptionMaxChars()
|
||||
if length := len([]rune(*form.AvatarDescription)); length > maxDescriptionChars {
|
||||
return fmt.Errorf("avatar description length must be less than %d characters (inclusive), but provided avatar description was %d chars", maxDescriptionChars, length)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user