Skip to content

Commit

Permalink
percent override
Browse files Browse the repository at this point in the history
  • Loading branch information
terrywbrady committed Apr 26, 2021
1 parent 71c3e4f commit 5ef8df5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/controllers/file_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ def storage_key_do
def fix_filename
# if the filename cannot be safely unencoded, look for a % in the original filename
fname = params_u(:file)
fname = Encoder.urlunencode(params[:file].gsub('%', '%25')) unless fname.valid_encoding?
return fname if fname.valid_encoding?
fname = Encoder.urlunencode(params[:file].gsub('%', '%25'))
return fname if fname.valid_encoding?
fname = Encoder.urlunencode(params[:file].gsub('%', '%25'))
fname
end

Expand Down

0 comments on commit 5ef8df5

Please sign in to comment.