mirror of https://gitlab.com/bashrc2/epicyon
Define strings outside of loop
parent
58f4840dd9
commit
cadb306b66
10
utils.py
10
utils.py
|
@ -825,6 +825,12 @@ def dangerousMarkup(content: str, allowLocalNetworkAccess: bool) -> bool:
|
||||||
"""Returns true if the given content contains dangerous html markup
|
"""Returns true if the given content contains dangerous html markup
|
||||||
"""
|
"""
|
||||||
separators = (['<', '>'], ['<', '>'])
|
separators = (['<', '>'], ['<', '>'])
|
||||||
|
invalidStrings = (
|
||||||
|
'script', 'noscript',
|
||||||
|
'canvas', 'style', 'abbr',
|
||||||
|
'frame', 'iframe', 'html', 'body',
|
||||||
|
'hr', 'allow-popups', 'allow-scripts'
|
||||||
|
)
|
||||||
for separatorStyle in separators:
|
for separatorStyle in separators:
|
||||||
startChar = separatorStyle[0]
|
startChar = separatorStyle[0]
|
||||||
endChar = separatorStyle[1]
|
endChar = separatorStyle[1]
|
||||||
|
@ -836,10 +842,6 @@ def dangerousMarkup(content: str, allowLocalNetworkAccess: bool) -> bool:
|
||||||
invalidPartials = ()
|
invalidPartials = ()
|
||||||
if not allowLocalNetworkAccess:
|
if not allowLocalNetworkAccess:
|
||||||
invalidPartials = getLocalNetworkAddresses()
|
invalidPartials = getLocalNetworkAddresses()
|
||||||
invalidStrings = ('script', 'noscript',
|
|
||||||
'canvas', 'style', 'abbr',
|
|
||||||
'frame', 'iframe', 'html', 'body',
|
|
||||||
'hr', 'allow-popups', 'allow-scripts')
|
|
||||||
for markup in contentSections:
|
for markup in contentSections:
|
||||||
if endChar not in markup:
|
if endChar not in markup:
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue