Skip to content

Commit a7028af

Browse files
committed
Patch for an Issue sqlmapproject#362 (more work required)
1 parent b4a55a8 commit a7028af

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

plugins/dbms/firebird/syntax.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ def __init__(self):
1515
@staticmethod
1616
def escape(expression, quote=True):
1717
def escaper(value):
18-
retVal = value
19-
if isDBMSVersionAtLeast('2.1'):
20-
retVal = "||".join("ASCII_CHAR(%d)" % ord(_) for _ in value)
21-
return retVal
18+
return "||".join("ASCII_CHAR(%d)" % ord(_) for _ in value)
2219

23-
return Syntax._escape(expression, quote, escaper)
20+
retVal = expression
21+
22+
if isDBMSVersionAtLeast('2.1'):
23+
retVal = Syntax._escape(expression, quote, escaper)
24+
25+
return retVal

plugins/dbms/sqlite/syntax.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ def __init__(self):
1717
@staticmethod
1818
def escape(expression, quote=True):
1919
def escaper(value):
20-
retVal = value
21-
if isDBMSVersionAtLeast('3'):
22-
retVal = "X'%s'" % binascii.hexlify(value)
23-
return retVal
20+
return "X'%s'" % binascii.hexlify(value)
2421

25-
return Syntax._escape(expression, quote, escaper)
22+
retVal = expression
23+
24+
if isDBMSVersionAtLeast('3'):
25+
retVal = Syntax._escape(expression, quote, escaper)
26+
27+
return retVal

0 commit comments

Comments
 (0)