Skip to content
Permalink
Browse files
fix: #342
  • Loading branch information
usmannasir committed May 20, 2020
1 parent 860fff0 commit d863d32a4ff4e2a8e54d39c0e6dd3a65781ebfd9
Showing 1 changed file with 33 additions and 2 deletions.
@@ -3222,7 +3222,23 @@ def setupRemote(self, userID=None, data=None):
else:
return ACLManager.loadErrorJson()

if validators.domain(self.gitHost) and ACLManager.validateInput(self.gitUsername) and ACLManager.validateInput(self.gitReponame):
if self.gitHost.find(':') > -1:
gitHostDomain = self.gitHost.split(':')[0]
gitHostPort = self.gitHost.split(':')[1]

if not validators.domain(gitHostDomain):
return ACLManager.loadErrorJson('status', 'Invalid characters in your input.')

try:
gitHostPort = int(gitHostPort)
except:
return ACLManager.loadErrorJson('status', 'Invalid characters in your input.')

else:
if not validators.domain(self.gitHost):
return ACLManager.loadErrorJson('status', 'Invalid characters in your input.')

if ACLManager.validateInput(self.gitUsername) and ACLManager.validateInput(self.gitReponame):
pass
else:
return ACLManager.loadErrorJson('status', 'Invalid characters in your input.')
@@ -3613,10 +3629,25 @@ def attachRepoGIT(self, userID=None, data=None):
else:
return ACLManager.loadErrorJson()

if self.gitHost.find(':') > -1:
gitHostDomain = self.gitHost.split(':')[0]
gitHostPort = self.gitHost.split(':')[1]

if not validators.domain(gitHostDomain):
return ACLManager.loadErrorJson('status', 'Invalid characters in your input.')

try:
gitHostPort = int(gitHostPort)
except:
return ACLManager.loadErrorJson('status', 'Invalid characters in your input.')
else:
if not validators.domain(self.gitHost):
return ACLManager.loadErrorJson('status', 'Invalid characters in your input.')


## Security check

if validators.domain(self.gitHost) and ACLManager.validateInput(self.gitUsername) and ACLManager.validateInput(self.gitReponame):
if ACLManager.validateInput(self.gitUsername) and ACLManager.validateInput(self.gitReponame):
pass
else:
return ACLManager.loadErrorJson('status', 'Invalid characters in your input.')

0 comments on commit d863d32

Please sign in to comment.