some refactoring

This commit is contained in:
Miroslav Stampar
2011-01-01 23:57:27 +00:00
parent 212035e64d
commit 428e817a32
3 changed files with 12 additions and 7 deletions

View File

@@ -1919,8 +1919,8 @@ def getInjectionTests():
detected DBMS from error messages
"""
retVal = conf.tests
if kb.htmlFp:
dbms = kb.htmlFp[-1]
if getErrorParsedDBMS():
dbms = getErrorParsedDBMS()
retVal = sorted(retVal, key=lambda test: False\
if 'details' in test and 'dbms' in test.details\
and test.details.dbms == dbms else True)
@@ -1953,3 +1953,6 @@ def unicodeToSafeHTMLValue(value):
if ord(char) > 127:
retVal = retVal.replace(char, "&#%d;" % ord(char))
return retVal
def getErrorParsedDBMS():
return kb.htmlFp[0] if kb.htmlFp else None