mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-01-24 16:24:25 +03:00
you can't believe how much man can learn when having good testing points
This commit is contained in:
parent
d225c5c9aa
commit
041abb56e2
|
@ -425,7 +425,7 @@ def dataToStdout(data, forceOutput=False):
|
||||||
try:
|
try:
|
||||||
sys.stdout.write(data)
|
sys.stdout.write(data)
|
||||||
except UnicodeEncodeError:
|
except UnicodeEncodeError:
|
||||||
sys.stdout.write(data.encode(kb.pageEncoding or conf.dataEncoding))
|
sys.stdout.write(data.encode(conf.dataEncoding))
|
||||||
finally:
|
finally:
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
|
||||||
|
@ -1515,11 +1515,17 @@ def getUnicode(value, encoding=None):
|
||||||
u'1'
|
u'1'
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if isinstance(value, basestring):
|
if isinstance(value, unicode):
|
||||||
return value if isinstance(value, unicode) else unicode(value, encoding or kb.pageEncoding or conf.dataEncoding, errors='replace')
|
return value
|
||||||
|
elif isinstance(value, basestring):
|
||||||
|
if encoding and encoding != conf.dataEncoding:
|
||||||
|
# transencoding from encoding to conf.dataEncoding
|
||||||
|
value = unicode(value, encoding, errors='replace').encode(conf.dataEncoding)
|
||||||
|
return unicode(value, conf.dataEncoding)
|
||||||
else:
|
else:
|
||||||
return unicode(value) # encoding ignored for non-basestring instances
|
return unicode(value) # encoding ignored for non-basestring instances
|
||||||
|
|
||||||
|
|
||||||
# http://boredzo.org/blog/archives/2007-01-06/longest-common-prefix-in-python-2
|
# http://boredzo.org/blog/archives/2007-01-06/longest-common-prefix-in-python-2
|
||||||
def longestCommonPrefix(*sequences):
|
def longestCommonPrefix(*sequences):
|
||||||
if len(sequences) == 1:
|
if len(sequences) == 1:
|
||||||
|
|
|
@ -142,7 +142,7 @@ def decodePage(page, contentEncoding, contentType):
|
||||||
charset = checkCharEncoding(charset)
|
charset = checkCharEncoding(charset)
|
||||||
kb.pageEncoding = charset or DEFAULT_PAGE_ENCODING
|
kb.pageEncoding = charset or DEFAULT_PAGE_ENCODING
|
||||||
|
|
||||||
return getUnicode(page)
|
return getUnicode(page, kb.pageEncoding)
|
||||||
|
|
||||||
def processResponse(page, responseHeaders):
|
def processResponse(page, responseHeaders):
|
||||||
page = getUnicode(page)
|
page = getUnicode(page)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user