mirror of https://gitlab.com/bashrc2/epicyon
Exclude code from markup, unless it is a git patch
parent
443c9599bf
commit
418897b7ce
1
inbox.py
1
inbox.py
|
@ -1870,6 +1870,7 @@ def _validPostContent(baseDir: str, nickname: str, domain: str,
|
||||||
print('WARN: invalid content warning ' + summary)
|
print('WARN: invalid content warning ' + summary)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
# check for patches before dangeousMarkup, which excludes code
|
||||||
if isGitPatch(baseDir, nickname, domain,
|
if isGitPatch(baseDir, nickname, domain,
|
||||||
messageJson['object']['type'],
|
messageJson['object']['type'],
|
||||||
summary,
|
summary,
|
||||||
|
|
2
utils.py
2
utils.py
|
@ -859,7 +859,7 @@ def dangerousMarkup(content: str, allowLocalNetworkAccess: bool) -> bool:
|
||||||
"""
|
"""
|
||||||
separators = [['<', '>'], ['<', '>']]
|
separators = [['<', '>'], ['<', '>']]
|
||||||
invalidStrings = [
|
invalidStrings = [
|
||||||
'script', 'noscript',
|
'script', 'noscript', 'code',
|
||||||
'canvas', 'style', 'abbr',
|
'canvas', 'style', 'abbr',
|
||||||
'frame', 'iframe', 'html', 'body',
|
'frame', 'iframe', 'html', 'body',
|
||||||
'hr', 'allow-popups', 'allow-scripts'
|
'hr', 'allow-popups', 'allow-scripts'
|
||||||
|
|
Loading…
Reference in New Issue