Fix bug allowing you to delete your own site directory

This commit is contained in:
Kyle Drake 2015-06-07 21:54:25 -07:00
parent 092eb4536f
commit 397f34a014
3 changed files with 26 additions and 0 deletions

View file

@ -637,6 +637,7 @@ class Site < Sequel::Model
end
def delete_file(path)
return false if files_path(path) == files_path
begin
FileUtils.rm files_path(path)
rescue Errno::EISDIR