forked from indymedia/epicyon
ssb address validation
parent
a9958736bb
commit
48e757c765
12
ssb.py
12
ssb.py
|
@ -31,6 +31,10 @@ def getSSBAddress(actorJson: {}) -> str:
|
||||||
continue
|
continue
|
||||||
if '"' in propertyValue['value']:
|
if '"' in propertyValue['value']:
|
||||||
continue
|
continue
|
||||||
|
if ' ' in propertyValue['value']:
|
||||||
|
continue
|
||||||
|
if ',' in propertyValue['value']:
|
||||||
|
continue
|
||||||
return propertyValue['value']
|
return propertyValue['value']
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
@ -54,15 +58,15 @@ def setSSBAddress(actorJson: {},ssbAddress: str) -> None:
|
||||||
if propertyFound:
|
if propertyFound:
|
||||||
actorJson['attachment'].remove(propertyFound)
|
actorJson['attachment'].remove(propertyFound)
|
||||||
|
|
||||||
if '@' not in ssbAddress:
|
|
||||||
return
|
|
||||||
if not ssbAddress.startswith('@'):
|
if not ssbAddress.startswith('@'):
|
||||||
return
|
return
|
||||||
if '.' not in ssbAddress:
|
if '=.' not in ssbAddress:
|
||||||
return
|
return
|
||||||
if '"' in ssbAddress:
|
if '"' in ssbAddress:
|
||||||
return
|
return
|
||||||
if ':' not in ssbAddress:
|
if ' ' in ssbAddress:
|
||||||
|
return
|
||||||
|
if ',' in ssbAddress:
|
||||||
return
|
return
|
||||||
|
|
||||||
for propertyValue in actorJson['attachment']:
|
for propertyValue in actorJson['attachment']:
|
||||||
|
|
Loading…
Reference in New Issue