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> Sylphid <sylphid.su@sti.com.tw>
for suggesting some features for suggesting some features
ToR <sstidus@email.it>
for reporting a minor bug
== Organizations == == Organizations ==
Black Hat team <info@blackhat.com> Black Hat team <info@blackhat.com>

View File

@ -81,8 +81,9 @@ def checkCharEncoding(encoding):
#http://www.destructor.de/charsets/index.htm #http://www.destructor.de/charsets/index.htm
translate = { 'windows-874':'iso-8859-11' } translate = { 'windows-874':'iso-8859-11' }
if ';' in encoding: for delimiter in (';', ','):
encoding = encoding[:encoding.find(';')] if delimiter in encoding:
encoding = encoding[:encoding.find(delimiter)]
# http://philip.html5.org/data/charsets-2.html # http://philip.html5.org/data/charsets-2.html
if encoding in translate: if encoding in translate:
@ -97,9 +98,9 @@ def checkCharEncoding(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
return encoding return encoding
def decodePage(page, contentEncoding, contentType): def decodePage(page, contentEncoding, contentType):