mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 05:45:59 +01:00
bug fix: allow file with spaces to be uploaded
This commit is contained in:
@@ -20,11 +20,9 @@ class FileManager:
|
||||
return HttpResponse(final_json)
|
||||
|
||||
def returnPathEnclosed(self, path):
|
||||
htmlParser = html.parser.HTMLParser()
|
||||
path = html.unescape(path)
|
||||
return path
|
||||
return "'" + path + "'"
|
||||
|
||||
|
||||
def changeOwner(self, path):
|
||||
domainName = self.data['domainName']
|
||||
website = Websites.objects.get(domain=domainName)
|
||||
@@ -367,8 +365,13 @@ class FileManager:
|
||||
|
||||
myfile = self.request.FILES['file']
|
||||
fs = FileSystemStorage()
|
||||
filename = fs.save(myfile.name, myfile)
|
||||
finalData['fileName'] = fs.url(filename)
|
||||
|
||||
try:
|
||||
filename = fs.save(myfile.name, myfile)
|
||||
finalData['fileName'] = fs.url(filename)
|
||||
except BaseException as msg:
|
||||
logging.writeToFile('%s. [375:upload]' % (str(msg)))
|
||||
|
||||
pathCheck = '/home/%s' % (self.data['domainName'])
|
||||
|
||||
if ACLManager.commandInjectionCheck(self.data['completePath'] + '/' + myfile.name) == 1:
|
||||
|
||||
Reference in New Issue
Block a user