diff options
author | 2023-05-25 15:18:15 +0200 | |
---|---|---|
committer | 2023-05-25 15:18:15 +0200 | |
commit | fc524f8cf16761f949303a96bca14e63c46ceda8 (patch) | |
tree | 7c73a836c4d0d89e3dbc672269ceabad082547e6 /internal/validate/formvalidation.go | |
parent | [bugfix] allow usernames of length 1 (#1823) (diff) | |
download | gotosocial-fc524f8cf16761f949303a96bca14e63c46ceda8.tar.xz |
[feature] Configurable custom css length (#1827)
* [feature] Make accounts custom css length configurable
* test custom css validation
Diffstat (limited to 'internal/validate/formvalidation.go')
-rw-r--r-- | internal/validate/formvalidation.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/validate/formvalidation.go b/internal/validate/formvalidation.go index f9328dc1f..c122bf2bc 100644 --- a/internal/validate/formvalidation.go +++ b/internal/validate/formvalidation.go @@ -41,7 +41,6 @@ const ( maximumDescriptionLength = 5000 maximumSiteTermsLength = 5000 maximumUsernameLength = 64 - maximumCustomCSSLength = 5000 maximumEmojiCategoryLength = 64 maximumProfileFieldLength = 255 maximumProfileFields = 6 @@ -170,9 +169,11 @@ func CustomCSS(customCSS string) error { return errors.New("accounts-allow-custom-css is not enabled for this instance") } + maximumCustomCSSLength := config.GetAccountsCustomCSSLength() if length := len([]rune(customCSS)); length > maximumCustomCSSLength { return fmt.Errorf("custom_css must be less than %d characters, but submitted custom_css was %d characters", maximumCustomCSSLength, length) } + return nil } |