mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-25 11:03:47 +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:
|
if quote:
|
||||||
unescaped = expression
|
unescaped = expression
|
||||||
for item in re.findall(r"'[^']+'", expression, re.S):
|
for item in re.findall(r"'[^']+'", expression, re.S):
|
||||||
|
try:
|
||||||
unescaped = unescaped.replace(item, "0x%s" % binascii.hexlify(item.strip("'")))
|
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:
|
else:
|
||||||
unescaped = "0x%s" % binascii.hexlify(expression)
|
unescaped = "0x%s" % binascii.hexlify(expression)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user