fix for bug reported by ToR (unknown charset 'utf-8, text/html')

This commit is contained in:
Miroslav Stampar 2010-11-02 18:01:10 +00:00
parent c7c84c3089
commit 861706fb31
2 changed files with 7 additions and 3 deletions

View File

@ -422,6 +422,9 @@ Stuffe <stuffe.dk@gmail.com>
Sylphid <sylphid.su@sti.com.tw>
for suggesting some features
ToR <sstidus@email.it>
for reporting a minor bug
== Organizations ==
Black Hat team <info@blackhat.com>

View File

@ -81,8 +81,9 @@ def checkCharEncoding(encoding):
#http://www.destructor.de/charsets/index.htm
translate = { 'windows-874':'iso-8859-11' }
if ';' in encoding:
encoding = encoding[:encoding.find(';')]
for delimiter in (';', ','):
if delimiter in encoding:
encoding = encoding[:encoding.find(delimiter)]
# http://philip.html5.org/data/charsets-2.html
if encoding in translate:
@ -97,9 +98,9 @@ def checkCharEncoding(encoding):
except LookupError:
warnMsg = "unknown charset '%s'. " % encoding
warnMsg += "Please report by e-mail to sqlmap-users@lists.sourceforge.net."
logger.warn(warnMsg)
encoding = conf.dataEncoding
return encoding
def decodePage(page, contentEncoding, contentType):