mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-29 13:03:50 +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")
|
||||
|
||||
def htmlescape(value):
|
||||
_ = (('&', '&'), ('<', '<'), ('>', '>'), ('"', '"'), ("'", '''), (' ', ' '))
|
||||
return reduce(lambda x, y: x.replace(y[0], y[1]), _, value)
|
||||
codes = (('&', '&'), ('<', '<'), ('>', '>'), ('"', '"'), ("'", '''), (' ', ' '))
|
||||
return reduce(lambda x, y: x.replace(y[0], y[1]), codes, value)
|
||||
|
||||
def htmlunescape(value):
|
||||
retVal = value
|
||||
if value and isinstance(value, basestring):
|
||||
_ = (('&', '&'), ('<', '<'), ('>', '>'), ('"', '"'), (' ', ' '))
|
||||
retVal = reduce(lambda x, y: x.replace(y[0], y[1]), _, retVal)
|
||||
retVal = re.sub('&#(\d+);', lambda x: unichr(int(x.group(1))), retVal)
|
||||
codes = (('<', '<'), ('>', '>'), ('"', '"'), (' ', ' '), ('&', '&'))
|
||||
retVal = reduce(lambda x, y: x.replace(y[0], y[1]), codes, retVal)
|
||||
retVal = re.sub('&#(\d+);', lambda x: getUnicode(chr(x.group(1))), retVal)
|
||||
return retVal
|
||||
|
|
Loading…
Reference in New Issue
Block a user