mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-09 06:01:29 +00:00
refactoring
This commit is contained in:
@@ -26,6 +26,7 @@ from lib.core.data import kb
|
||||
from lib.core.data import logger
|
||||
from lib.core.settings import META_CHARSET_REGEX
|
||||
from lib.core.settings import DEFAULT_PAGE_ENCODING
|
||||
from lib.core.settings import UNICODE_ENCODING
|
||||
from lib.parse.headers import headersParser
|
||||
from lib.parse.html import htmlParser
|
||||
|
||||
@@ -113,7 +114,7 @@ def checkCharEncoding(encoding):
|
||||
warnMsg = "unknown charset '%s'. " % encoding
|
||||
warnMsg += "Please report by e-mail to sqlmap-users@lists.sourceforge.net."
|
||||
logger.warn(warnMsg)
|
||||
encoding = conf.dataEncoding
|
||||
encoding = UNICODE_ENCODING
|
||||
|
||||
return encoding
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ from lib.core.data import kb
|
||||
from lib.core.data import logger
|
||||
from lib.core.enums import DBMS
|
||||
from lib.core.settings import SQL_STATEMENTS
|
||||
from lib.core.settings import UNICODE_ENCODING
|
||||
from lib.utils.timeout import timeout
|
||||
|
||||
def direct(query, content=True):
|
||||
@@ -49,7 +50,7 @@ def direct(query, content=True):
|
||||
output = timeout(func=conf.dbmsConnector.select, args=(query,), duration=conf.timeout, default=None)
|
||||
|
||||
infoMsg = "resumed from file '%s': " % conf.sessionFile
|
||||
infoMsg += "%s..." % getUnicode(output, conf.dataEncoding)[:20]
|
||||
infoMsg += "%s..." % getUnicode(output, UNICODE_ENCODING)[:20]
|
||||
logger.info(infoMsg)
|
||||
else:
|
||||
output = timeout(func=conf.dbmsConnector.select, args=(query,), duration=conf.timeout, default=None)
|
||||
@@ -65,7 +66,7 @@ def direct(query, content=True):
|
||||
out = list(output)[0][0]
|
||||
if isinstance(out, str):
|
||||
out = utf8decode(out)
|
||||
return getUnicode(out, conf.dataEncoding)
|
||||
return getUnicode(out, UNICODE_ENCODING)
|
||||
else:
|
||||
return list(output)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user