mirror of
https://github.com/neocities/neocities.git
synced 2025-07-25 03:48:22 +02:00
prevent creation of empty path with rename
This commit is contained in:
parent
671b29bc9f
commit
75f225fd88
2 changed files with 15 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue