diff --git a/Gemfile b/Gemfile index 1f2420b3e..26f3aa56e 100644 --- a/Gemfile +++ b/Gemfile @@ -38,7 +38,7 @@ gem 'friendly_id', '~> 5.5.1' ## 数据分页 gem 'kaminari', '~> 1.2.2' ## 文件上传 -gem 'carrierwave', '~> 2.2.3' +gem 'carrierwave', '~> 3.0.4' gem 'webp-ffi', '~> 0.4.0' # Helper diff --git a/Gemfile.lock b/Gemfile.lock index aed4b2cf4..683d6f4c0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -84,7 +84,7 @@ GEM minitest (>= 5.1) mutex_m tzinfo (~> 2.0) - addressable (2.8.1) + addressable (2.8.5) public_suffix (>= 2.0.2, < 6.0) aes_key_wrap (1.1.0) android_parser (2.6.0) @@ -117,13 +117,12 @@ GEM bootsnap (1.17.0) msgpack (~> 1.2) builder (3.2.4) - carrierwave (2.2.3) - activemodel (>= 5.0.0) - activesupport (>= 5.0.0) + carrierwave (3.0.5) + activemodel (>= 6.0.0) + activesupport (>= 6.0.0) addressable (~> 2.6) image_processing (~> 1.1) marcel (~> 1.0.0) - mini_mime (>= 0.1.3) ssrf_filter (~> 1.0) case_transform (0.2) activesupport @@ -165,7 +164,7 @@ GEM faraday-follow_redirects (0.3.0) faraday (>= 1, < 3) faraday-net_http (3.0.2) - ffi (1.15.5) + ffi (1.16.3) ffi-compiler (1.0.1) ffi (>= 1.0.0) rake @@ -361,7 +360,7 @@ GEM pry (>= 0.12.0) psych (5.1.1.1) stringio - public_suffix (5.0.1) + public_suffix (5.0.4) puma (6.4.0) nio4r (~> 2.0) pundit (2.3.1) @@ -466,7 +465,7 @@ GEM rubocop (>= 1.33.0, < 2.0) ruby-macho (3.0.0) ruby-progressbar (1.11.0) - ruby-vips (2.1.4) + ruby-vips (2.2.0) ffi (~> 1.12) ruby2_keywords (0.0.5) rubyntlm (0.6.3) @@ -510,7 +509,7 @@ GEM actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - ssrf_filter (1.1.1) + ssrf_filter (1.1.2) stimulus-rails (1.3.0) railties (>= 6.0.0) stringio (3.1.0) @@ -579,7 +578,7 @@ DEPENDENCIES better_errors binding_of_caller bootsnap (>= 1.4.7) - carrierwave (~> 2.2.3) + carrierwave (~> 3.0.4) cssbundling-rails (~> 1.3) debug (~> 1.8.0) devise (~> 4.9.3) diff --git a/app/uploaders/app_icon_uploader.rb b/app/uploaders/app_icon_uploader.rb index 6c7fa4cac..d095bf5d2 100644 --- a/app/uploaders/app_icon_uploader.rb +++ b/app/uploaders/app_icon_uploader.rb @@ -9,14 +9,6 @@ def store_dir "#{base_store_dir}/apps/a#{model.app.id}/r#{model.id}/icons" end - # @param [ActionDispatch::Http::UploadedFile] file - def filename - return super unless not_png?(file) - - filename = File.basename(file.path) - "#{filename}.png" - end - def content_type_allowlist /image\// end