mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-09 22:21:30 +00:00
more unicode refactoring
This commit is contained in:
@@ -94,7 +94,7 @@ def decodePage(page, encoding):
|
||||
Decode gzip/deflate HTTP response
|
||||
"""
|
||||
|
||||
if unicode(encoding).lower() in ('gzip', 'x-gzip', 'deflate'):
|
||||
if isinstance(encoding, basestring) and encoding.lower() in ('gzip', 'x-gzip', 'deflate'):
|
||||
if encoding == 'deflate':
|
||||
# http://stackoverflow.com/questions/1089662/python-inflate-and-deflate-implementations
|
||||
data = StringIO.StringIO(zlib.decompress(page, -15))
|
||||
|
||||
@@ -24,6 +24,7 @@ Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
from lib.core.agent import agent
|
||||
from lib.core.common import dataToSessionFile
|
||||
from lib.core.common import getUnicode
|
||||
from lib.core.convert import base64pickle
|
||||
from lib.core.convert import base64unpickle
|
||||
from lib.core.convert import utf8decode
|
||||
@@ -55,7 +56,7 @@ def direct(query, content=True):
|
||||
output = base64unpickle(kb.resumedQueries[conf.hostname][query][:-1])
|
||||
|
||||
infoMsg = "resumed from file '%s': " % conf.sessionFile
|
||||
infoMsg += "%s..." % unicode(output)[:20]
|
||||
infoMsg += "%s..." % getUnicode(output)[:20]
|
||||
logger.info(infoMsg)
|
||||
elif select:
|
||||
output = timeout(func=conf.dbmsConnector.select, args=(query,), duration=conf.timeout, default=None)
|
||||
|
||||
Reference in New Issue
Block a user