mirror of
https://github.com/neocities/neocities.git
synced 2025-08-02 07:41:52 +02:00
Merge branch 'master' into api
This commit is contained in:
commit
32f50916fa
2 changed files with 17 additions and 9 deletions
9
app.rb
9
app.rb
|
@ -285,14 +285,9 @@ post '/site_files/upload' do
|
|||
end
|
||||
|
||||
sanitized_filename = params[:newfile][:filename].gsub(/[^a-zA-Z0-9_\-.]/, '')
|
||||
|
||||
current_site.store_file sanitized_filename, params[:newfile][:tempfile]
|
||||
|
||||
if sanitized_filename =~ /index\.html/
|
||||
ScreenshotWorker.perform_async current_site.username
|
||||
current_site.update site_changed: true
|
||||
end
|
||||
|
||||
current_site.update changed_count: 1+current_site.changed_count, updated_at: Time.now
|
||||
current_site.increment_changed_count
|
||||
|
||||
flash[:success] = "Successfully uploaded file #{sanitized_filename}."
|
||||
redirect '/dashboard'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue