mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 09:42:36 +02:00
catch for directory edit attempt
This commit is contained in:
parent
9874ce3c5f
commit
4e847e2295
1 changed files with 3 additions and 0 deletions
|
@ -115,6 +115,9 @@ get %r{\/site_files\/text_editor\/(.+)} do
|
||||||
rescue Errno::ENOENT
|
rescue Errno::ENOENT
|
||||||
flash[:error] = 'We could not find the requested file.'
|
flash[:error] = 'We could not find the requested file.'
|
||||||
redirect '/dashboard'
|
redirect '/dashboard'
|
||||||
|
rescue Errno::EISDIR
|
||||||
|
flash[:error] = 'Cannot edit a directory.'
|
||||||
|
redirect '/dashboard'
|
||||||
end
|
end
|
||||||
erb :'site_files/text_editor'
|
erb :'site_files/text_editor'
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue