mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-03 05:04:11 +03:00
Minor refactoring of direct()
This commit is contained in:
parent
91ea8e52b7
commit
c7cf8b2e80
|
@ -11,6 +11,7 @@ from extra.safe2bin.safe2bin import safecharencode
|
|||
from lib.core.agent import agent
|
||||
from lib.core.common import Backend
|
||||
from lib.core.common import calculateDeltaSeconds
|
||||
from lib.core.common import extractExpectedValue
|
||||
from lib.core.common import getCurrentThreadData
|
||||
from lib.core.common import getUnicode
|
||||
from lib.core.common import hashDBRetrieve
|
||||
|
@ -21,6 +22,7 @@ from lib.core.data import kb
|
|||
from lib.core.data import logger
|
||||
from lib.core.dicts import SQL_STATEMENTS
|
||||
from lib.core.enums import DBMS
|
||||
from lib.core.enums import EXPECTED
|
||||
from lib.core.settings import UNICODE_ENCODING
|
||||
from lib.utils.timeout import timeout
|
||||
|
||||
|
@ -62,16 +64,9 @@ def direct(query, content=True):
|
|||
elif content:
|
||||
if output and isListLike(output):
|
||||
if len(output[0]) == 1:
|
||||
if len(output) > 1:
|
||||
output = map(lambda _: _[0], output)
|
||||
else:
|
||||
output = output[0][0]
|
||||
output = [_[0] for _ in output]
|
||||
|
||||
retVal = getUnicode(output, noneToNull=True)
|
||||
return safecharencode(retVal) if kb.safeCharEncode else retVal
|
||||
else:
|
||||
for line in output:
|
||||
if line[0] in (1, -1):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
return extractExpectedValue(output, EXPECTED.BOOL)
|
||||
|
|
Loading…
Reference in New Issue
Block a user