forked from indymedia/epicyon
Check that ports are digits
parent
c84fae54f1
commit
c6b002652b
|
@ -109,7 +109,9 @@ def manualApproveFollowRequest(session,baseDir: str, \
|
|||
handleOfFollowRequester=handleOfFollowRequester.replace('\n','')
|
||||
port2=port
|
||||
if ':' in handleOfFollowRequester:
|
||||
port2=int(handleOfFollowRequester.split(':')[1])
|
||||
port2Str=handleOfFollowRequester.split(':')[1]
|
||||
if port2Str.isdigit():
|
||||
port2=int(port2Str)
|
||||
requestsDir=accountDir+'/requests'
|
||||
followActivityfilename=requestsDir+'/'+handleOfFollowRequester+'.follow'
|
||||
if os.path.isfile(followActivityfilename):
|
||||
|
|
|
@ -83,7 +83,10 @@ def outboxSkills(baseDir: str,nickname: str,messageJson: {},debug: bool) -> bool
|
|||
return False
|
||||
domain,port=getDomainFromActor(messageJson['actor'])
|
||||
skill=messageJson['object'].replace('"','').split(';')[0].strip()
|
||||
skillLevelPercent=int(messageJson['object'].replace('"','').split(';')[1].strip())
|
||||
skillLevelPercentStr=messageJson['object'].replace('"','').split(';')[1].strip()
|
||||
skillLevelPercent=50
|
||||
if skillLevelPercentStr.isdigit():
|
||||
skillLevelPercent=int(skillLevelPercentStr)
|
||||
|
||||
return setSkillLevel(baseDir,nickname,domain, \
|
||||
skill,skillLevelPercent)
|
||||
|
|
|
@ -48,7 +48,9 @@ def webfingerHandle(session,handle: str,httpPrefix: str,cachedWebfingers: {}, \
|
|||
return None
|
||||
wfDomain=domain
|
||||
if ':' in wfDomain:
|
||||
#wfPort=int(wfDomain.split(':')[1])
|
||||
#wfPortStr=wfDomain.split(':')[1]
|
||||
#if wfPortStr.isdigit():
|
||||
# wfPort=int(wfPortStr)
|
||||
#if wfPort==80 or wfPort==443:
|
||||
wfDomain=wfDomain.split(':')[0]
|
||||
wf=getWebfingerFromCache(nickname+'@'+wfDomain,cachedWebfingers)
|
||||
|
|
|
@ -4923,7 +4923,9 @@ def htmlProfileAfterSearch(recentPostsCache: {},maxRecentPosts: int, \
|
|||
searchDomain=profileHandle.split('@')[1]
|
||||
searchPort=None
|
||||
if ':' in searchDomain:
|
||||
searchPort=int(searchDomain.split(':')[1])
|
||||
searchPortStr=searchDomain.split(':')[1]
|
||||
if searchPortStr.isdigit():
|
||||
searchPort=int(searchPortStr)
|
||||
searchDomain=searchDomain.split(':')[0]
|
||||
if not searchNickname:
|
||||
if debug:
|
||||
|
|
Loading…
Reference in New Issue