mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-16 19:40:37 +03:00
minor refactoring
This commit is contained in:
parent
3abcd6910a
commit
645fc8a21c
|
@ -30,15 +30,8 @@ class Syntax(GenericSyntax):
|
||||||
|
|
||||||
lastIndex = firstIndex + index
|
lastIndex = firstIndex + index
|
||||||
old = "'%s'" % expression[firstIndex:lastIndex]
|
old = "'%s'" % expression[firstIndex:lastIndex]
|
||||||
#unescaped = "("
|
unescaped = "||".join("%s(%d)" % ("CHR" if ord(expression[i]) < 256 else "NCHR", ord(expression[i])) for i in xrange(firstIndex, lastIndex))
|
||||||
unescaped = ""
|
|
||||||
|
|
||||||
for i in xrange(firstIndex, lastIndex):
|
|
||||||
unescaped += "%s(%d)" % ("CHR" if ord(expression[i]) < 256 else "NCHR", ord(expression[i]))
|
|
||||||
if i < lastIndex - 1:
|
|
||||||
unescaped += "||"
|
|
||||||
|
|
||||||
#unescaped += ")"
|
|
||||||
expression = expression.replace(old, unescaped)
|
expression = expression.replace(old, unescaped)
|
||||||
else:
|
else:
|
||||||
expression = "||".join("CHR(%d)" % ord(c) for c in expression)
|
expression = "||".join("CHR(%d)" % ord(c) for c in expression)
|
||||||
|
|
|
@ -30,16 +30,8 @@ class Syntax(GenericSyntax):
|
||||||
|
|
||||||
lastIndex = firstIndex + index
|
lastIndex = firstIndex + index
|
||||||
old = "'%s'" % expression[firstIndex:lastIndex]
|
old = "'%s'" % expression[firstIndex:lastIndex]
|
||||||
#unescaped = "("
|
unescaped = "||".join("CHR(%d)" % (ord(expression[i])) for i in xrange(firstIndex, lastIndex)) # Postgres CHR() function already accepts Unicode code point of character(s)
|
||||||
unescaped = ""
|
|
||||||
|
|
||||||
for i in xrange(firstIndex, lastIndex):
|
|
||||||
# Postgres CHR() function already accepts Unicode code point of character(s)
|
|
||||||
unescaped += "CHR(%d)" % (ord(expression[i]))
|
|
||||||
if i < lastIndex - 1:
|
|
||||||
unescaped += "||"
|
|
||||||
|
|
||||||
#unescaped += ")"
|
|
||||||
expression = expression.replace(old, unescaped)
|
expression = expression.replace(old, unescaped)
|
||||||
else:
|
else:
|
||||||
expression = "||".join("CHR(%d)" % ord(c) for c in expression)
|
expression = "||".join("CHR(%d)" % ord(c) for c in expression)
|
||||||
|
|
|
@ -30,14 +30,8 @@ class Syntax(GenericSyntax):
|
||||||
|
|
||||||
lastIndex = firstIndex + index
|
lastIndex = firstIndex + index
|
||||||
old = "'%s'" % expression[firstIndex:lastIndex]
|
old = "'%s'" % expression[firstIndex:lastIndex]
|
||||||
unescaped = ""
|
unescaped = "+".join("%s(%d)" % ("CHAR" if ord(expression[i]) < 256 else "TO_UNICHAR", ord(expression[i])) for i in xrange(firstIndex, lastIndex))
|
||||||
|
|
||||||
for i in xrange(firstIndex, lastIndex):
|
|
||||||
unescaped += "%s(%d)" % ("CHAR" if ord(expression[i]) < 256 else "TO_UNICHAR", ord(expression[i]))
|
|
||||||
if i < lastIndex - 1:
|
|
||||||
unescaped += "+"
|
|
||||||
|
|
||||||
#unescaped += ")"
|
|
||||||
expression = expression.replace(old, unescaped)
|
expression = expression.replace(old, unescaped)
|
||||||
else:
|
else:
|
||||||
expression = "+".join("CHAR(%d)" % ord(c) for c in expression)
|
expression = "+".join("CHAR(%d)" % ord(c) for c in expression)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user