mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-08-04 06:50:14 +00:00
update for a previous update (putting conf.dataEncoding in getUnicode wherever we know that data won't be 'touched' or 'used' in anyway related to the current web page - if not sure, just leave it as it is)
This commit is contained in:
parent
08ccbf2c1e
commit
0eabca9fd4
9 changed files with 12 additions and 14 deletions
|
|
@ -89,7 +89,7 @@ class UnicodeRawConfigParser(RawConfigParser):
|
|||
fp.write("[%s]\n" % DEFAULTSECT)
|
||||
|
||||
for (key, value) in self._defaults.items():
|
||||
fp.write("%s = %s\n" % (key, getUnicode(value).replace('\n', '\n\t')))
|
||||
fp.write("%s = %s\n" % (key, getUnicode(value, conf.dataEncoding).replace('\n', '\n\t')))
|
||||
|
||||
fp.write("\n")
|
||||
|
||||
|
|
@ -101,7 +101,7 @@ class UnicodeRawConfigParser(RawConfigParser):
|
|||
if value is None:
|
||||
fp.write("%s\n" % (key))
|
||||
else:
|
||||
fp.write("%s = %s\n" % (key, getUnicode(value).replace('\n', '\n\t')))
|
||||
fp.write("%s = %s\n" % (key, getUnicode(value, conf.dataEncoding).replace('\n', '\n\t')))
|
||||
|
||||
fp.write("\n")
|
||||
|
||||
|
|
@ -498,7 +498,7 @@ def readInput(message, default=None):
|
|||
message += " "
|
||||
|
||||
if conf.batch and default:
|
||||
infoMsg = "%s%s" % (message, getUnicode(default))
|
||||
infoMsg = "%s%s" % (message, getUnicode(default, conf.dataEncoding))
|
||||
logger.info(infoMsg)
|
||||
|
||||
debugMsg = "used the default behaviour, running in batch mode"
|
||||
|
|
@ -1511,7 +1511,7 @@ def getUnicode(value, encoding=None):
|
|||
"""
|
||||
|
||||
if isinstance(value, basestring):
|
||||
return value if isinstance(value, unicode) else unicode(value, encoding or kb.pageEncoding or "utf-8", errors='replace')
|
||||
return value if isinstance(value, unicode) else unicode(value, encoding or kb.pageEncoding or conf.dataEncoding, errors='replace')
|
||||
else:
|
||||
return unicode(value) # encoding ignored for non-basestring instances
|
||||
|
||||
|
|
|
|||
|
|
@ -1183,7 +1183,7 @@ def __setKnowledgeBaseAttributes(flushAll=True):
|
|||
kb.osVersion = None
|
||||
kb.osSP = None
|
||||
|
||||
kb.pageEncoding = "utf-8"
|
||||
kb.pageEncoding = None
|
||||
kb.pageStable = None
|
||||
kb.partRun = None
|
||||
kb.proxyAuthHeader = None
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ def profile(profileOutputFile=None, dotOutputFile=None, imageOutputFile=None):
|
|||
import gtk
|
||||
import pydot
|
||||
except ImportError, e:
|
||||
errMsg = "profiling requires third-party libraries (%s)" % getUnicode(e)
|
||||
errMsg = "profiling requires third-party libraries (%s)" % getUnicode(e, conf.dataEncoding)
|
||||
logger.error(errMsg)
|
||||
return
|
||||
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ def __updateSqlmap():
|
|||
logger.debug(debugMsg)
|
||||
|
||||
def notify(event_dict):
|
||||
action = getUnicode(event_dict['action'])
|
||||
action = getUnicode(event_dict['action'], conf.dataEncoding)
|
||||
index = action.find('_')
|
||||
prefix = action[index + 1].upper() if index != -1 else action.capitalize()
|
||||
|
||||
|
|
@ -211,7 +211,7 @@ def __updateSqlmap():
|
|||
if action.find('_completed') == -1:
|
||||
dataToStdout("%s\t%s\n" % (prefix, event_dict['path']))
|
||||
else:
|
||||
revision = getUnicode(event_dict['revision'])
|
||||
revision = getUnicode(event_dict['revision'], conf.dataEncoding)
|
||||
index = revision.find('number ')
|
||||
|
||||
if index != -1:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue