mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-25 02:53:46 +03:00
minor update regarding unicode unescaping
This commit is contained in:
parent
40991a5d52
commit
300abc2ba2
|
@ -22,7 +22,10 @@ class Syntax(GenericSyntax):
|
|||
if quote:
|
||||
unescaped = expression
|
||||
for item in re.findall(r"'[^']+'", expression, re.S):
|
||||
unescaped = unescaped.replace(item, "0x%s" % binascii.hexlify(item.strip("'")))
|
||||
try:
|
||||
unescaped = unescaped.replace(item, "0x%s" % binascii.hexlify(item.strip("'")))
|
||||
except UnicodeEncodeError:
|
||||
unescaped = unescaped.replace(item, "CHAR(0x%s USING utf8)" % "".join(("%.2x" % ord(_)) if ord(_) < 256 else ("%.4x" % ord(_)) for _ in item.strip("'")))
|
||||
else:
|
||||
unescaped = "0x%s" % binascii.hexlify(expression)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user