mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
Merge pull request #21 from talklittle/master
Fixed GH-20 "Numbers are stripped from filenames on save"
This commit is contained in:
commit
44b61170e5
1 changed files with 1 additions and 1 deletions
2
app.rb
2
app.rb
|
@ -295,7 +295,7 @@ post '/site_files/save/:filename' do |filename|
|
|||
tmpfile.write input
|
||||
tmpfile.close
|
||||
|
||||
sanitized_filename = filename.gsub(/[^a-zA-Z_\-.]/, '')
|
||||
sanitized_filename = filename.gsub(/[^a-zA-Z0-9_\-.]/, '')
|
||||
dest_path = File.join site_base_path(current_site.username), sanitized_filename
|
||||
|
||||
FileUtils.mv tmpfile.path, dest_path
|
||||
|
|
Loading…
Add table
Reference in a new issue