mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
A fix for the encoding issue, finally.
This commit is contained in:
parent
3a1bdb38fd
commit
ab9f5fbeb2
1 changed files with 4 additions and 1 deletions
5
app.rb
5
app.rb
|
@ -50,6 +50,7 @@ get '/new' do
|
||||||
end
|
end
|
||||||
|
|
||||||
get '/dashboard' do
|
get '/dashboard' do
|
||||||
|
require_login
|
||||||
slim :'dashboard'
|
slim :'dashboard'
|
||||||
end
|
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.'
|
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
|
end
|
||||||
|
|
||||||
tmpfile.write request.body.read
|
input = request.body.read
|
||||||
|
tmpfile.set_encoding input.encoding
|
||||||
|
tmpfile.write input
|
||||||
tmpfile.close
|
tmpfile.close
|
||||||
|
|
||||||
sanitized_filename = filename.gsub(/[^a-zA-Z_\-.]/, '')
|
sanitized_filename = filename.gsub(/[^a-zA-Z_\-.]/, '')
|
||||||
|
|
Loading…
Add table
Reference in a new issue