mirror of
https://github.com/neocities/neocities.git
synced 2025-08-03 16:21:52 +02:00
fix when unicode is used for filename and dir
This commit is contained in:
parent
e9afe63695
commit
b54b2a4818
4 changed files with 18 additions and 1 deletions
|
@ -130,7 +130,8 @@ post '/site_files/upload' do
|
|||
end
|
||||
end
|
||||
|
||||
file[:filename] = "#{dir_name}/#{site.scrubbed_path file[:filename]}"
|
||||
file[:filename] = "#{dir_name.force_encoding('UTF-8')}/#{site.scrubbed_path file[:filename].force_encoding('UTF-8')}"
|
||||
|
||||
if current_site.file_size_too_large? file[:tempfile].size
|
||||
file_upload_response "#{Rack::Utils.escape_html file[:filename]} is too large, upload cancelled."
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue