mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-12-01 22:13:53 +03:00
Minor style update
This commit is contained in:
parent
63bf99ce77
commit
6809449e31
|
@ -136,13 +136,13 @@ def utf8decode(value):
|
||||||
return value.decode("utf-8")
|
return value.decode("utf-8")
|
||||||
|
|
||||||
def htmlescape(value):
|
def htmlescape(value):
|
||||||
_ = (('&', '&'), ('<', '<'), ('>', '>'), ('"', '"'), ("'", '''), (' ', ' '))
|
codes = (('&', '&'), ('<', '<'), ('>', '>'), ('"', '"'), ("'", '''), (' ', ' '))
|
||||||
return reduce(lambda x, y: x.replace(y[0], y[1]), _, value)
|
return reduce(lambda x, y: x.replace(y[0], y[1]), codes, value)
|
||||||
|
|
||||||
def htmlunescape(value):
|
def htmlunescape(value):
|
||||||
retVal = value
|
retVal = value
|
||||||
if value and isinstance(value, basestring):
|
if value and isinstance(value, basestring):
|
||||||
_ = (('&', '&'), ('<', '<'), ('>', '>'), ('"', '"'), (' ', ' '))
|
codes = (('<', '<'), ('>', '>'), ('"', '"'), (' ', ' '), ('&', '&'))
|
||||||
retVal = reduce(lambda x, y: x.replace(y[0], y[1]), _, retVal)
|
retVal = reduce(lambda x, y: x.replace(y[0], y[1]), codes, retVal)
|
||||||
retVal = re.sub('&#(\d+);', lambda x: unichr(int(x.group(1))), retVal)
|
retVal = re.sub('&#(\d+);', lambda x: getUnicode(chr(x.group(1))), retVal)
|
||||||
return retVal
|
return retVal
|
||||||
|
|
Loading…
Reference in New Issue
Block a user