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

Skip to content

Commit a973196

Browse files
committed
optimization - now if DBMS was detected by error based HTML parser, then it's moved at the first place for testing
1 parent 729156e commit a973196

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

lib/controller/handler.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def setHandler():
4747

4848
count = 0
4949
dbmsNames = ( "MySQL", "Oracle", "PostgreSQL", "Microsoft SQL Server", "SQLite", "Microsoft Access", "Firebird", "SAP MaxDB", "Sybase" )
50-
dbmsMap = (
50+
dbmsMap = [
5151
( MYSQL_ALIASES, MySQLMap, MySQLConn ),
5252
( ORACLE_ALIASES, OracleMap, OracleConn ),
5353
( PGSQL_ALIASES, PostgreSQLMap, PostgreSQLConn ),
@@ -57,7 +57,18 @@ def setHandler():
5757
( FIREBIRD_ALIASES, FirebirdMap, FirebirdConn ),
5858
( MAXDB_ALIASES, MaxDBMap, MaxDBConn ),
5959
( SYBASE_ALIASES, SybaseMap, SybaseConn ),
60-
)
60+
]
61+
62+
if kb.htmlFp:
63+
for i in xrange(len(dbmsMap)):
64+
dbmsAliases, _, _ = dbmsMap[i]
65+
if kb.htmlFp[-1].lower() in dbmsAliases:
66+
if i > 0:
67+
temp = dbmsMap[i]
68+
dbmsMap.remove(temp)
69+
dbmsMap.insert(0, temp)
70+
break
71+
6172

6273
for dbmsAliases, dbmsMap, dbmsConn in dbmsMap:
6374
if conf.dbms and conf.dbms not in dbmsAliases:

0 commit comments

Comments
 (0)