mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 21:20:07 +08: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 00209f03e6bc55c6dd776dbe828b8bb53cd935f4 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:
@ -35,7 +35,7 @@ class Admin::SiteSettingsController < Admin::AdminController
|
||||
when :integer
|
||||
value = value.tr("^-0-9", "")
|
||||
when :file_size_restriction
|
||||
value = value.tr("^-0-9", "")
|
||||
value = value.tr("^0-9", "").to_i
|
||||
when :uploaded_image_list
|
||||
value = Upload.get_from_urls(value.split("|")).to_a
|
||||
end
|
||||
|
Reference in New Issue
Block a user