Skip to content

Commit

Permalink
Sanitize error messages when rendering directly
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-kephart committed Apr 11, 2023
1 parent 8e5a0d2 commit 4485788
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/controllers/camaleon_cms/admin/media_controller.rb
Expand Up @@ -80,7 +80,7 @@ def actions
cama_tmp_upload(params[:url], formats: params[:formats], name: params[:name])
end
if r[:error].present?
render plain: r[:error]
render plain: helpers.sanitize(r[:error])
else
params[:file_upload] = r[:file_path]
sett = { remove_source: true }
Expand All @@ -106,7 +106,7 @@ def upload(settings = {})
end

if f[:error].present?
render plain: f[:error]
render plain: helpers.sanitize(f[:error])
else
render partial: 'render_file_item', locals: { files: [f] }
end
Expand Down

0 comments on commit 4485788

Please sign in to comment.