mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Ensure file size restriction types are ints (#24947)
Settings that are using the new `file_size_restriction` types like the
`max_image_size_kb` setting need to have their values saved as integers.
This was a recent regression in 00209f03e6
that caused these values to be saved as strings.
This change also removes negatives from the validation regex because
file sizes can't be negative anyways.
Bug report: https://meta.discourse.org/t/289037
This commit is contained in:
@@ -59,7 +59,7 @@ class Topic < ActiveRecord::Base
|
||||
|
||||
def thumbnail_info(enqueue_if_missing: false, extra_sizes: [])
|
||||
return nil unless original = image_upload
|
||||
return nil if original.filesize >= SiteSetting.max_image_size_kb.kilobytes
|
||||
return nil if original.filesize >= SiteSetting.max_image_size_kb.to_i.kilobytes
|
||||
return nil unless original.read_attribute(:width) && original.read_attribute(:height)
|
||||
|
||||
infos = []
|
||||
|
||||
Reference in New Issue
Block a user