DEV: Add file_size_restriction site setting type (#24704)

This change will allow admins to configure file sizes in mb instead of
having to convert to kb.

Co-authored-by: Ella <ella.estigoy@gmail.com>
This commit is contained in:
Blake Erickson
2023-12-13 16:22:48 -07:00
committed by GitHub
parent 89826ef56d
commit 00209f03e6
15 changed files with 382 additions and 31 deletions

View File

@ -86,7 +86,7 @@ RSpec.describe ShrinkUploadedImage do
it "returns false when the upload is above the size limit" do
post = Fabricate(:post, raw: "<img src='#{upload.url}'>")
post.link_post_uploads
SiteSetting.max_image_size_kb = 0.001 # 1 byte
SiteSetting.max_image_size_kb = 0
result =
ShrinkUploadedImage.new(