Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6825bf8

Browse files
committed
Debugging broken Travis (2)
1 parent 4fa39f4 commit 6825bf8

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty.six import unichr as _unichr
1919

2020
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21-
VERSION = "1.4.2.18"
21+
VERSION = "1.4.2.19"
2222
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2323
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2424
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

lib/request/basic.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
Copyright (c) 2006-2020 sqlmap developers (http://sqlmap.org/)
55
See the file 'LICENSE' for copying permission
66
"""
7+
from __future__ import print_function
78

89
import codecs
910
import gzip
@@ -174,7 +175,7 @@ def checkCharEncoding(encoding, warn=True):
174175
if encoding:
175176
encoding = encoding.lower()
176177
else:
177-
return "A" # encoding
178+
return encoding
178179

179180
# Reference: http://www.destructor.de/charsets/index.htm
180181
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):
227228
if encoding in translate:
228229
encoding = translate[encoding]
229230
elif encoding in ("null", "{charset}", "charset", "*") or not re.search(r"\w", encoding):
230-
return "B" # None
231+
return None
231232

232233
# Reference: http://www.iana.org/assignments/character-sets
233234
# Reference: http://docs.python.org/library/codecs.html
@@ -238,8 +239,12 @@ def checkCharEncoding(encoding, warn=True):
238239

239240
if encoding:
240241
try:
241-
six.text_type(getBytes(randomStr()), encoding)
242-
except:
242+
_ = getBytes(randomStr())
243+
print(repr(_))
244+
print(encoding)
245+
six.text_type(_, encoding)
246+
except Exception as ex:
247+
print(getSafeExString(ex))
243248
if warn:
244249
warnMsg = "invalid web page charset '%s'" % encoding
245250
singleTimeLogMessage(warnMsg, logging.WARN, encoding)

0 commit comments

Comments
 (0)