forked from indymedia/epicyon
Check that strings are valid
parent
ba091b74e4
commit
419b5746c7
14
blocking.py
14
blocking.py
|
@ -134,9 +134,10 @@ def isBlocked(baseDir: str,nickname: str,domain: str, \
|
||||||
if os.path.isfile(globalBlockingFilename):
|
if os.path.isfile(globalBlockingFilename):
|
||||||
if '*@'+blockDomain in open(globalBlockingFilename).read():
|
if '*@'+blockDomain in open(globalBlockingFilename).read():
|
||||||
return True
|
return True
|
||||||
blockHandle=blockNickname+'@'+blockDomain
|
if blockNickname and blockDomain:
|
||||||
if blockHandle in open(globalBlockingFilename).read():
|
blockHandle=blockNickname+'@'+blockDomain
|
||||||
return True
|
if blockHandle in open(globalBlockingFilename).read():
|
||||||
|
return True
|
||||||
allowFilename= \
|
allowFilename= \
|
||||||
baseDir+'/accounts/'+nickname+'@'+domain+'/allowedinstances.txt'
|
baseDir+'/accounts/'+nickname+'@'+domain+'/allowedinstances.txt'
|
||||||
if os.path.isfile(allowFilename):
|
if os.path.isfile(allowFilename):
|
||||||
|
@ -147,9 +148,10 @@ def isBlocked(baseDir: str,nickname: str,domain: str, \
|
||||||
if os.path.isfile(blockingFilename):
|
if os.path.isfile(blockingFilename):
|
||||||
if '*@'+blockDomain in open(blockingFilename).read():
|
if '*@'+blockDomain in open(blockingFilename).read():
|
||||||
return True
|
return True
|
||||||
blockHandle=blockNickname+'@'+blockDomain
|
if blockNickname and blockDomain:
|
||||||
if blockHandle in open(blockingFilename).read():
|
blockHandle=blockNickname+'@'+blockDomain
|
||||||
return True
|
if blockHandle in open(blockingFilename).read():
|
||||||
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def sendBlockViaServer(baseDir: str,session, \
|
def sendBlockViaServer(baseDir: str,session, \
|
||||||
|
|
Loading…
Reference in New Issue