mirror of https://gitlab.com/bashrc2/epicyon
More hashtag checks
parent
a1677048d5
commit
00af89ff3e
|
@ -114,7 +114,7 @@ def _validHashtagCategory(category: str) -> bool:
|
||||||
if not category:
|
if not category:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
invalidChars = (',', ' ', '<', ';', '\\', '"', '&')
|
invalidChars = (',', ' ', '<', ';', '\\', '"', '&', '#')
|
||||||
for ch in invalidChars:
|
for ch in invalidChars:
|
||||||
if ch in category:
|
if ch in category:
|
||||||
return False
|
return False
|
||||||
|
|
|
@ -382,7 +382,7 @@ def validHashTag(hashtag: str) -> bool:
|
||||||
'abcdefghijklmnopqrstuvwxyz' +
|
'abcdefghijklmnopqrstuvwxyz' +
|
||||||
'ABCDEFGHIJKLMNOPQRSTUVWXYZ')
|
'ABCDEFGHIJKLMNOPQRSTUVWXYZ')
|
||||||
if set(hashtag).issubset(validChars):
|
if set(hashtag).issubset(validChars):
|
||||||
if '&' not in hashtag:
|
if '&' not in hashtag and '#' not in hashtag:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
@ -154,7 +154,10 @@ def htmlHashTagSwarm(baseDir: str, actor: str, translate: {}) -> str:
|
||||||
if len(hashTagName) > maxTagLength:
|
if len(hashTagName) > maxTagLength:
|
||||||
# NoIncrediblyLongAndBoringHashtagsShownHere
|
# NoIncrediblyLongAndBoringHashtagsShownHere
|
||||||
continue
|
continue
|
||||||
if '&' in hashTagName or '"' in hashTagName or "'" in hashTagName:
|
if '#' in hashTagName or \
|
||||||
|
'&' in hashTagName or \
|
||||||
|
'"' in hashTagName or \
|
||||||
|
"'" in hashTagName:
|
||||||
continue
|
continue
|
||||||
if '#' + hashTagName + '\n' in blockedStr:
|
if '#' + hashTagName + '\n' in blockedStr:
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue