A fix for the encoding issue, finally.

This commit is contained in:
Kyle Drake 2013-06-21 20:58:44 -07:00
parent 3a1bdb38fd
commit ab9f5fbeb2

5
app.rb
View file

@ -50,6 +50,7 @@ get '/new' do
end
get '/dashboard' do
require_login
slim :'dashboard'
end
@ -208,7 +209,9 @@ post '/site_files/save/:filename' do |filename|
halt 'File is too large to fit in your space, it has NOT been saved. Please make a local copy and then try to reduce the size.'
end
tmpfile.write request.body.read
input = request.body.read
tmpfile.set_encoding input.encoding
tmpfile.write input
tmpfile.close
sanitized_filename = filename.gsub(/[^a-zA-Z_\-.]/, '')