diff options
author | Marius Balteanu <marius.balteanu@zitec.com> | 2024-05-07 18:36:46 +0000 |
---|---|---|
committer | Marius Balteanu <marius.balteanu@zitec.com> | 2024-05-07 18:36:46 +0000 |
commit | b4bfb6b581035b52a193c74ac74825f3652a014a (patch) | |
tree | 5cb102d4869ab473f9c8fa2e7844079b623ca5da /app/models | |
parent | 9ef1cdd375793b05d9ef7a6036678168f2704750 (diff) | |
download | redmine-b4bfb6b581035b52a193c74ac74825f3652a014a.tar.gz redmine-b4bfb6b581035b52a193c74ac74825f3652a014a.zip |
Replaces use of Digest::MD5 / Digest::SHA1 with ActiveSupport::Digest (#35217).
Patch by Jens Krämer (@jkraemer).
git-svn-id: https://svn.redmine.org/redmine/trunk@22816 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/attachment.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/attachment.rb b/app/models/attachment.rb index c9054e903..59addf528 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -135,7 +135,7 @@ class Attachment < ApplicationRecord end # Copies the temporary file to its final location - # and computes its MD5 hash + # and computes its hash def files_to_final_location if @temp_file self.disk_directory = target_directory @@ -559,7 +559,7 @@ class Attachment < ApplicationRecord if %r{^[a-zA-Z0-9_\.\-]*$}.match?(filename) && filename.length <= 50 ascii = filename else - ascii = Digest::MD5.hexdigest(filename) + ascii = ActiveSupport::Digest.hexdigest(filename) # keep the extension if any ascii << $1 if filename =~ %r{(\.[a-zA-Z0-9]+)$} end |