mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-08 14:26:16 +01:00
path check to upload
This commit is contained in:
@@ -334,8 +334,9 @@ class FileManager:
|
|||||||
fs = FileSystemStorage()
|
fs = FileSystemStorage()
|
||||||
filename = fs.save(myfile.name, myfile)
|
filename = fs.save(myfile.name, myfile)
|
||||||
finalData['fileName'] = fs.url(filename)
|
finalData['fileName'] = fs.url(filename)
|
||||||
|
pathCheck = '/home/%s' % (self.data['domainName'])
|
||||||
|
|
||||||
if not self.data['completePath'].find(self.data['home']) > -1:
|
if self.data['completePath'].find(pathCheck) == -1:
|
||||||
return self.ajaxPre(0, 'Not allowed to move in this path, please choose location inside home!')
|
return self.ajaxPre(0, 'Not allowed to move in this path, please choose location inside home!')
|
||||||
|
|
||||||
command = 'mv ' + self.returnPathEnclosed('/home/cyberpanel/media/' + myfile.name) + ' ' + self.returnPathEnclosed(self.data['completePath'] + '/' + myfile.name)
|
command = 'mv ' + self.returnPathEnclosed('/home/cyberpanel/media/' + myfile.name) + ' ' + self.returnPathEnclosed(self.data['completePath'] + '/' + myfile.name)
|
||||||
|
|||||||
Reference in New Issue
Block a user