From 523de4f3f760c79061a747329d150f81a1499efb Mon Sep 17 00:00:00 2001 From: Du Peng Date: Mon, 11 Mar 2024 12:46:39 +0100 Subject: [PATCH] (bug) #content_type_whitelist is instead by #content_type_allowlist --- CHANGELOG.md | 2 ++ app/uploaders/custom_assets_uploader.rb | 4 ++-- app/uploaders/event_file_uploader.rb | 4 ++-- app/uploaders/event_image_uploader.rb | 4 ++-- app/uploaders/import_uploader.rb | 4 ++-- app/uploaders/machine_file_uploader.rb | 4 ++-- app/uploaders/machine_image_uploader.rb | 4 ++-- app/uploaders/plan_file_uploader.rb | 4 ++-- app/uploaders/product_file_uploader.rb | 4 ++-- app/uploaders/product_image_uploader.rb | 4 ++-- app/uploaders/project_cao_uploader.rb | 4 ++-- app/uploaders/project_image_uploader.rb | 4 ++-- app/uploaders/space_file_uploader.rb | 4 ++-- app/uploaders/space_image_uploader.rb | 4 ++-- app/uploaders/supporting_document_file_uploader.rb | 4 ++-- app/uploaders/training_image_uploader.rb | 4 ++-- app/uploaders/user_avatar_uploader.rb | 4 ++-- 17 files changed, 34 insertions(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3eefdc4159..f74c134c25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ - Fix a bug: set settlement by cash by default for local payment mean - updates translations +- #content_type_whitelist is instead by #content_type_allowlist +- #extension_whitelist is instead by #extension_allowlist - [TODO DEPLOY] `rails fablab:setup:build_accounting_lines` ## v6.3.15 2024 February 29 diff --git a/app/uploaders/custom_assets_uploader.rb b/app/uploaders/custom_assets_uploader.rb index 3fc789cd74..ad783434a2 100644 --- a/app/uploaders/custom_assets_uploader.rb +++ b/app/uploaders/custom_assets_uploader.rb @@ -48,11 +48,11 @@ def base_store_dir # Add a white list of extensions which are allowed to be uploaded. # For images you might use something like this: - def extension_whitelist + def extension_allowlist %w[pdf png jpeg jpg ico] end - def content_type_whitelist + def content_type_allowlist [%r{image/}, 'application/pdf'] end diff --git a/app/uploaders/event_file_uploader.rb b/app/uploaders/event_file_uploader.rb index 43752a117f..35e2419d8f 100644 --- a/app/uploaders/event_file_uploader.rb +++ b/app/uploaders/event_file_uploader.rb @@ -41,11 +41,11 @@ def base_store_dir # Add a white list of extensions which are allowed to be uploaded. # For images you might use something like this: - def extension_whitelist + def extension_allowlist %w[pdf] end - def content_type_whitelist + def content_type_allowlist %w[application/pdf] end diff --git a/app/uploaders/event_image_uploader.rb b/app/uploaders/event_image_uploader.rb index 90d8c965aa..57a2ced7dd 100644 --- a/app/uploaders/event_image_uploader.rb +++ b/app/uploaders/event_image_uploader.rb @@ -59,11 +59,11 @@ def base_store_dir # Add a white list of extensions which are allowed to be uploaded. # For images you might use something like this: - def extension_whitelist + def extension_allowlist %w[jpg jpeg gif png] end - def content_type_whitelist + def content_type_allowlist [%r{image/}] end diff --git a/app/uploaders/import_uploader.rb b/app/uploaders/import_uploader.rb index 34a7cbd738..486c3d0628 100644 --- a/app/uploaders/import_uploader.rb +++ b/app/uploaders/import_uploader.rb @@ -22,11 +22,11 @@ def base_store_dir # Add a white list of extensions which are allowed to be uploaded. # For images you might use something like this: - def extension_whitelist + def extension_allowlist %w[csv] end - def content_type_whitelist + def content_type_allowlist %w[text/csv] end diff --git a/app/uploaders/machine_file_uploader.rb b/app/uploaders/machine_file_uploader.rb index a7d2128312..1b06ea4d55 100644 --- a/app/uploaders/machine_file_uploader.rb +++ b/app/uploaders/machine_file_uploader.rb @@ -41,11 +41,11 @@ def base_store_dir # Add a white list of extensions which are allowed to be uploaded. # For images you might use something like this: - def extension_whitelist + def extension_allowlist %w[pdf] end - def content_type_whitelist + def content_type_allowlist %w[application/pdf] end diff --git a/app/uploaders/machine_image_uploader.rb b/app/uploaders/machine_image_uploader.rb index 0141731e1c..4dcd0f5ea4 100644 --- a/app/uploaders/machine_image_uploader.rb +++ b/app/uploaders/machine_image_uploader.rb @@ -51,11 +51,11 @@ def base_store_dir # Add a white list of extensions which are allowed to be uploaded. # For images you might use something like this: - def extension_whitelist + def extension_allowlist %w[jpg jpeg gif png] end - def content_type_whitelist + def content_type_allowlist [%r{image/}] end diff --git a/app/uploaders/plan_file_uploader.rb b/app/uploaders/plan_file_uploader.rb index 680ef86afe..983322e02b 100644 --- a/app/uploaders/plan_file_uploader.rb +++ b/app/uploaders/plan_file_uploader.rb @@ -41,11 +41,11 @@ def base_store_dir # Add a white list of extensions which are allowed to be uploaded. # For images you might use something like this: - def extension_whitelist + def extension_allowlist %w[pdf png jpeg jpg] end - def content_type_whitelist + def content_type_allowlist [%r{image/}, 'application/pdf'] end diff --git a/app/uploaders/product_file_uploader.rb b/app/uploaders/product_file_uploader.rb index 1cee5d75ca..316a8d9eb2 100644 --- a/app/uploaders/product_file_uploader.rb +++ b/app/uploaders/product_file_uploader.rb @@ -46,11 +46,11 @@ def base_store_dir # Add a white list of extensions which are allowed to be uploaded. # For images you might use something like this: - def extension_whitelist + def extension_allowlist %w[pdf] end - def content_type_whitelist + def content_type_allowlist ['application/pdf'] end diff --git a/app/uploaders/product_image_uploader.rb b/app/uploaders/product_image_uploader.rb index caaa61799e..90a522c366 100644 --- a/app/uploaders/product_image_uploader.rb +++ b/app/uploaders/product_image_uploader.rb @@ -39,11 +39,11 @@ def base_store_dir # Add a white list of extensions which are allowed to be uploaded. # For images you might use something like this: - def extension_whitelist + def extension_allowlist %w[jpg jpeg gif png webp] end - def content_type_whitelist + def content_type_allowlist [%r{image/}] end diff --git a/app/uploaders/project_cao_uploader.rb b/app/uploaders/project_cao_uploader.rb index 0b060198fc..25ba2f0ce8 100644 --- a/app/uploaders/project_cao_uploader.rb +++ b/app/uploaders/project_cao_uploader.rb @@ -23,11 +23,11 @@ def base_store_dir # Add a white list of extensions which are allowed to be uploaded. # For images you might use something like this: - def extension_whitelist + def extension_allowlist Setting.get('allowed_cad_extensions').split(' ') end - def content_type_whitelist + def content_type_allowlist Setting.get('allowed_cad_mime_types').split(' ') end end diff --git a/app/uploaders/project_image_uploader.rb b/app/uploaders/project_image_uploader.rb index 96e9d5bf6a..aed3ffb8eb 100644 --- a/app/uploaders/project_image_uploader.rb +++ b/app/uploaders/project_image_uploader.rb @@ -29,11 +29,11 @@ def base_store_dir # Add a white list of extensions which are allowed to be uploaded. # For images you might use something like this: - def extension_whitelist + def extension_allowlist %w[jpg jpeg gif png] end - def content_type_whitelist + def content_type_allowlist [%r{image/}] end diff --git a/app/uploaders/space_file_uploader.rb b/app/uploaders/space_file_uploader.rb index 1cdf2cf20a..ccd30427ce 100644 --- a/app/uploaders/space_file_uploader.rb +++ b/app/uploaders/space_file_uploader.rb @@ -41,11 +41,11 @@ def base_store_dir # Add a white list of extensions which are allowed to be uploaded. # For images you might use something like this: - def extension_whitelist + def extension_allowlist %w[pdf] end - def content_type_whitelist + def content_type_allowlist %w[application/pdf] end diff --git a/app/uploaders/space_image_uploader.rb b/app/uploaders/space_image_uploader.rb index 4c5b57a298..ad9759f10a 100644 --- a/app/uploaders/space_image_uploader.rb +++ b/app/uploaders/space_image_uploader.rb @@ -51,11 +51,11 @@ def base_store_dir # Add a white list of extensions which are allowed to be uploaded. # For images you might use something like this: - def extension_whitelist + def extension_allowlist %w[jpg jpeg gif png] end - def content_type_whitelist + def content_type_allowlist [%r{image/}] end diff --git a/app/uploaders/supporting_document_file_uploader.rb b/app/uploaders/supporting_document_file_uploader.rb index 9cc533a2d4..a94dfbf003 100644 --- a/app/uploaders/supporting_document_file_uploader.rb +++ b/app/uploaders/supporting_document_file_uploader.rb @@ -47,11 +47,11 @@ def base_store_dir # Add a white list of extensions which are allowed to be uploaded. # For images you might use something like this: - def extension_whitelist + def extension_allowlist %w[pdf png jpeg jpg] end - def content_type_whitelist + def content_type_allowlist [%r{image/}, 'application/pdf'] end diff --git a/app/uploaders/training_image_uploader.rb b/app/uploaders/training_image_uploader.rb index 8d87b40256..8d6e4206db 100644 --- a/app/uploaders/training_image_uploader.rb +++ b/app/uploaders/training_image_uploader.rb @@ -51,11 +51,11 @@ def base_store_dir # Add a white list of extensions which are allowed to be uploaded. # For images you might use something like this: - def extension_whitelist + def extension_allowlist %w[jpg jpeg gif png] end - def content_type_whitelist + def content_type_allowlist [%r{image/}] end diff --git a/app/uploaders/user_avatar_uploader.rb b/app/uploaders/user_avatar_uploader.rb index 6c9f40cedd..9841a0e691 100644 --- a/app/uploaders/user_avatar_uploader.rb +++ b/app/uploaders/user_avatar_uploader.rb @@ -55,11 +55,11 @@ def base_store_dir # Add a white list of extensions which are allowed to be uploaded. # For images you might use something like this: - def extension_whitelist + def extension_allowlist %w[jpg jpeg gif png] end - def content_type_whitelist + def content_type_allowlist %w[image/jpeg image/gif image/png] end