FEATURE: Validate setting combination between exif strip and img opt (#16662)

Admins won't be able to disable strip_image_metadata if they don't
disable composer_media_optimization_image_enabled first since the later
will strip the same metadata on client during upload, making disabling
the former have no effect.

Bug report at https://meta.discourse.org/t/-/223350
This commit is contained in:
Rafael dos Santos Silva
2022-05-05 15:13:17 -03:00
committed by GitHub
parent 4b92175d4e
commit 94cfe98ee4
3 changed files with 41 additions and 0 deletions

View File

@ -239,6 +239,12 @@ module SiteSettings::Validations
end
end
def validate_strip_image_metadata(new_val)
return if new_val == "t"
return if SiteSetting.composer_media_optimization_image_enabled == false
validate_error :strip_image_metadata_cannot_be_disabled_if_composer_media_optimization_image_enabled
end
private
def validate_bucket_setting(setting_name, upload_bucket, backup_bucket)