mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-29 04:53:48 +03:00
Fix escaper
This commit is contained in:
parent
4595b2c287
commit
eb2012c599
|
@ -16,6 +16,11 @@ class Syntax(GenericSyntax):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def escape(expression, quote=True):
|
def escape(expression, quote=True):
|
||||||
|
"""
|
||||||
|
>>> Syntax.escape("SELECT 'abcdefgh' FROM foobar")
|
||||||
|
'SELECT CHAR(97)||CHAR(98)||CHAR(99)||CHAR(100)||CHAR(101)||CHAR(102)||CHAR(103)||CHAR(104) FROM foobar'
|
||||||
|
"""
|
||||||
def escaper(value):
|
def escaper(value):
|
||||||
retVal = "||".join("CHAR(%d)" % ord(value[i]) for i in xrange(len(value)))
|
return "||".join("CHAR(%d)" % ord(value[i]) for i in xrange(len(value)))
|
||||||
return retVal
|
|
||||||
|
return Syntax._escape(expression, quote, escaper)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user