mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 17:46:37 +03:00
Debugging broken Travis (2)
This commit is contained in:
parent
4fa39f4539
commit
6825bf85a4
|
@ -18,7 +18,7 @@ from lib.core.enums import OS
|
||||||
from thirdparty.six import unichr as _unichr
|
from thirdparty.six import unichr as _unichr
|
||||||
|
|
||||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||||
VERSION = "1.4.2.18"
|
VERSION = "1.4.2.19"
|
||||||
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
||||||
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
||||||
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
Copyright (c) 2006-2020 sqlmap developers (http://sqlmap.org/)
|
Copyright (c) 2006-2020 sqlmap developers (http://sqlmap.org/)
|
||||||
See the file 'LICENSE' for copying permission
|
See the file 'LICENSE' for copying permission
|
||||||
"""
|
"""
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
import codecs
|
import codecs
|
||||||
import gzip
|
import gzip
|
||||||
|
@ -174,7 +175,7 @@ def checkCharEncoding(encoding, warn=True):
|
||||||
if encoding:
|
if encoding:
|
||||||
encoding = encoding.lower()
|
encoding = encoding.lower()
|
||||||
else:
|
else:
|
||||||
return "A" # encoding
|
return encoding
|
||||||
|
|
||||||
# Reference: http://www.destructor.de/charsets/index.htm
|
# Reference: http://www.destructor.de/charsets/index.htm
|
||||||
translate = {"windows-874": "iso-8859-11", "utf-8859-1": "utf8", "en_us": "utf8", "macintosh": "iso-8859-1", "euc_tw": "big5_tw", "th": "tis-620", "unicode": "utf8", "utc8": "utf8", "ebcdic": "ebcdic-cp-be", "iso-8859": "iso8859-1", "iso-8859-0": "iso8859-1", "ansi": "ascii", "gbk2312": "gbk", "windows-31j": "cp932", "en": "us"}
|
translate = {"windows-874": "iso-8859-11", "utf-8859-1": "utf8", "en_us": "utf8", "macintosh": "iso-8859-1", "euc_tw": "big5_tw", "th": "tis-620", "unicode": "utf8", "utc8": "utf8", "ebcdic": "ebcdic-cp-be", "iso-8859": "iso8859-1", "iso-8859-0": "iso8859-1", "ansi": "ascii", "gbk2312": "gbk", "windows-31j": "cp932", "en": "us"}
|
||||||
|
@ -227,7 +228,7 @@ def checkCharEncoding(encoding, warn=True):
|
||||||
if encoding in translate:
|
if encoding in translate:
|
||||||
encoding = translate[encoding]
|
encoding = translate[encoding]
|
||||||
elif encoding in ("null", "{charset}", "charset", "*") or not re.search(r"\w", encoding):
|
elif encoding in ("null", "{charset}", "charset", "*") or not re.search(r"\w", encoding):
|
||||||
return "B" # None
|
return None
|
||||||
|
|
||||||
# Reference: http://www.iana.org/assignments/character-sets
|
# Reference: http://www.iana.org/assignments/character-sets
|
||||||
# Reference: http://docs.python.org/library/codecs.html
|
# Reference: http://docs.python.org/library/codecs.html
|
||||||
|
@ -238,8 +239,12 @@ def checkCharEncoding(encoding, warn=True):
|
||||||
|
|
||||||
if encoding:
|
if encoding:
|
||||||
try:
|
try:
|
||||||
six.text_type(getBytes(randomStr()), encoding)
|
_ = getBytes(randomStr())
|
||||||
except:
|
print(repr(_))
|
||||||
|
print(encoding)
|
||||||
|
six.text_type(_, encoding)
|
||||||
|
except Exception as ex:
|
||||||
|
print(getSafeExString(ex))
|
||||||
if warn:
|
if warn:
|
||||||
warnMsg = "invalid web page charset '%s'" % encoding
|
warnMsg = "invalid web page charset '%s'" % encoding
|
||||||
singleTimeLogMessage(warnMsg, logging.WARN, encoding)
|
singleTimeLogMessage(warnMsg, logging.WARN, encoding)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user