Fixes for webdav directories

This commit is contained in:
Kyle Drake 2015-11-11 13:50:24 -08:00
parent 4195b903d7
commit 06778925e0
4 changed files with 21 additions and 2 deletions

View file

@ -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?