Skip to content

Commit f8ba109

Browse files
committed
path check to upload
1 parent 5c491a2 commit f8ba109

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

filemanager/filemanager.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,9 @@ def upload(self):
334334
fs = FileSystemStorage()
335335
filename = fs.save(myfile.name, myfile)
336336
finalData['fileName'] = fs.url(filename)
337+
pathCheck = '/home/%s' % (self.data['domainName'])
337338

338-
if not self.data['completePath'].find(self.data['home']) > -1:
339+
if self.data['completePath'].find(pathCheck) == -1:
339340
return self.ajaxPre(0, 'Not allowed to move in this path, please choose location inside home!')
340341

341342
command = 'mv ' + self.returnPathEnclosed('/home/cyberpanel/media/' + myfile.name) + ' ' + self.returnPathEnclosed(self.data['completePath'] + '/' + myfile.name)

0 commit comments

Comments
 (0)