Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bbffea2

Browse files
committed
bug fix
1 parent 0eb2c40 commit bbffea2

10 files changed

Lines changed: 12 additions & 23 deletions

File tree

lib/core/unescaper.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,14 @@
77
See the file 'doc/COPYING' for copying permission
88
"""
99

10+
from lib.core.data import kb
1011
from lib.core.datatype import advancedDict
1112

1213
class Unescaper(advancedDict):
1314
def __init__(self):
14-
self.__unescaper = None
15-
16-
def setUnescape(self, unescapeFunction):
17-
self.__unescaper = unescapeFunction
15+
pass
1816

1917
def unescape(self, expression, quote=True):
20-
return self.__unescaper(expression, quote=quote)
18+
return self[kb.dbms if kb.dbms else kb.misc.testedDbms](expression, quote=quote)
2119

2220
unescaper = Unescaper()

plugins/dbms/access/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,4 @@ def __init__(self):
3333
Miscellaneous.__init__(self)
3434
Takeover.__init__(self)
3535

36-
unescaper[DBMS.ACCESS] = AccessMap.unescape
37-
unescaper.setUnescape(AccessMap.unescape)
36+
unescaper[DBMS.ACCESS] = Syntax.unescape

plugins/dbms/firebird/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,4 @@ def __init__(self):
3333
Miscellaneous.__init__(self)
3434
Takeover.__init__(self)
3535

36-
unescaper[DBMS.FIREBIRD] = FirebirdMap.unescape
37-
unescaper.setUnescape(FirebirdMap.unescape)
36+
unescaper[DBMS.FIREBIRD] = Syntax.unescape

plugins/dbms/maxdb/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,4 @@ def __init__(self):
3333
Miscellaneous.__init__(self)
3434
Takeover.__init__(self)
3535

36-
unescaper[DBMS.MAXDB] = MaxDBMap.unescape
37-
unescaper.setUnescape(MaxDBMap.unescape)
36+
unescaper[DBMS.MAXDB] = Syntax.unescape

plugins/dbms/mssqlserver/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,4 @@ def __init__(self):
3434
Miscellaneous.__init__(self)
3535
Takeover.__init__(self)
3636

37-
unescaper[DBMS.MSSQL] = MSSQLServerMap.unescape
38-
unescaper.setUnescape(MSSQLServerMap.unescape)
37+
unescaper[DBMS.MSSQL] = Syntax.unescape

plugins/dbms/mysql/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,4 @@ def __init__(self):
3939
Miscellaneous.__init__(self)
4040
Takeover.__init__(self)
4141

42-
unescaper[DBMS.MYSQL] = MySQLMap.unescape
43-
unescaper.setUnescape(MySQLMap.unescape)
42+
unescaper[DBMS.MYSQL] = Syntax.unescape

plugins/dbms/oracle/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,4 @@ def __init__(self):
3333
Miscellaneous.__init__(self)
3434
Takeover.__init__(self)
3535

36-
unescaper[DBMS.ORACLE] = OracleMap.unescape
37-
unescaper.setUnescape(OracleMap.unescape)
36+
unescaper[DBMS.ORACLE] = Syntax.unescape

plugins/dbms/postgresql/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,4 @@ def __init__(self):
4040
Miscellaneous.__init__(self)
4141
Takeover.__init__(self)
4242

43-
unescaper[DBMS.PGSQL] = PostgreSQLMap.unescape
44-
unescaper.setUnescape(PostgreSQLMap.unescape)
43+
unescaper[DBMS.PGSQL] = Syntax.unescape

plugins/dbms/sqlite/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,4 @@ def __init__(self):
3333
Miscellaneous.__init__(self)
3434
Takeover.__init__(self)
3535

36-
unescaper[DBMS.SQLITE] = SQLiteMap.unescape
37-
unescaper.setUnescape(SQLiteMap.unescape)
36+
unescaper[DBMS.SQLITE] = Syntax.unescape

plugins/dbms/sybase/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,4 @@ def __init__(self):
3333
Miscellaneous.__init__(self)
3434
Takeover.__init__(self)
3535

36-
unescaper[DBMS.SYBASE] = SybaseMap.unescape
37-
unescaper.setUnescape(SybaseMap.unescape)
36+
unescaper[DBMS.SYBASE] = Syntax.unescape

0 commit comments

Comments
 (0)