prevent creation of empty path with rename

This commit is contained in:
Kyle Drake 2022-06-22 18:29:58 -05:00
parent 671b29bc9f
commit 75f225fd88
2 changed files with 15 additions and 0 deletions

View file

@ -44,6 +44,10 @@ class SiteFile < Sequel::Model
current_path = self.path
new_path = site.scrubbed_path new_path
if new_path == ''
return false, 'cannot rename to empty path'
end
if current_path == 'index.html'
return false, 'cannot rename or move root index.html'
end