Minor cosmetic fixes

This commit is contained in:
Bernardo Damele 2010-10-14 15:28:54 +00:00
parent 2bbe0c9ba6
commit 1674142d82
2 changed files with 5 additions and 3 deletions

View File

@ -87,18 +87,20 @@ def checkCharEncoding(encoding):
if ';' in encoding: if ';' in encoding:
encoding = encoding[:encoding.find(';')] encoding = encoding[:encoding.find(';')]
#http://philip.html5.org/data/charsets-2.html
# http://philip.html5.org/data/charsets-2.html
if encoding in translate: if encoding in translate:
encoding = translate[encoding] encoding = translate[encoding]
elif encoding.startswith('cp-'): elif encoding.startswith('cp-'):
encoding = 'cp%s' % encoding[3:] encoding = 'cp%s' % encoding[3:]
elif encoding.startswith('windows') and not encoding.startswith('windows-'): elif encoding.startswith('windows') and not encoding.startswith('windows-'):
encoding = 'windows-%s' % encoding[7:] encoding = 'windows-%s' % encoding[7:]
try: try:
codecs.lookup(encoding) codecs.lookup(encoding)
except LookupError: except LookupError:
warnMsg = "unknown charset '%s'. " % encoding warnMsg = "unknown charset '%s'. " % encoding
warnMsg += "please report by e-mail to sqlmap-users@lists.sourceforge.net." warnMsg += "Please report by e-mail to sqlmap-users@lists.sourceforge.net."
logger.warn(warnMsg) logger.warn(warnMsg)
encoding = conf.dataEncoding encoding = conf.dataEncoding

View File

@ -93,7 +93,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
progress = ProgressBar(maxValue=length) progress = ProgressBar(maxValue=length)
progressTime = [] progressTime = []
if numThreads is not None: if numThreads > 1:
debugMsg = "starting %d thread%s" % (numThreads, ("s" if numThreads > 1 else "")) debugMsg = "starting %d thread%s" % (numThreads, ("s" if numThreads > 1 else ""))
logger.debug(debugMsg) logger.debug(debugMsg)