mirror of
https://github.com/neocities/neocities.git
synced 2025-08-03 00:02:00 +02:00
Fixes for webdav directories
This commit is contained in:
parent
4195b903d7
commit
06778925e0
4 changed files with 21 additions and 2 deletions
|
@ -671,7 +671,7 @@ class Site < Sequel::Model
|
|||
return 'Directory (or file) already exists.'
|
||||
end
|
||||
|
||||
path_dirs = path.to_s.split '/'
|
||||
path_dirs = path.to_s.split('/').select {|p| ![nil, '.', ''].include?(p) }
|
||||
|
||||
path_site_file = ''
|
||||
|
||||
|
@ -682,6 +682,8 @@ class Site < Sequel::Model
|
|||
path_site_file += '/' + path_dirs.shift
|
||||
end
|
||||
|
||||
raise ArgumentError, 'directory name cannot be empty' if path_site_file == ''
|
||||
|
||||
site_file = SiteFile.where(site_id: self.id, path: path_site_file).first
|
||||
|
||||
if site_file.nil?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue