Skip to content

Commit 638dbf2

Browse files
committed
Fixes #2818
1 parent a90b5f7 commit 638dbf2

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

lib/core/settings.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from lib.core.enums import OS
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.1.12.6"
22+
VERSION = "1.1.12.7"
2323
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2424
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2525
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
@@ -202,6 +202,11 @@
202202
# Reference: http://en.wikipedia.org/wiki/ISO/IEC_8859-1
203203
DEFAULT_PAGE_ENCODING = "iso-8859-1"
204204

205+
try:
206+
unicode(DEFAULT_PAGE_ENCODING, DEFAULT_PAGE_ENCODING)
207+
except LookupError:
208+
DEFAULT_PAGE_ENCODING = "utf8"
209+
205210
# URL used in dummy runs
206211
DUMMY_URL = "http://foo/bar?id=1"
207212

lib/request/basic.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,7 @@ def decodePage(page, contentEncoding, contentType):
299299

300300
metaCharset = checkCharEncoding(extractRegexResult(META_CHARSET_REGEX, page))
301301

302-
if (any((httpCharset, metaCharset)) and not all((httpCharset, metaCharset)))\
303-
or (httpCharset == metaCharset and all((httpCharset, metaCharset))):
302+
if (any((httpCharset, metaCharset)) and not all((httpCharset, metaCharset))) or (httpCharset == metaCharset and all((httpCharset, metaCharset))):
304303
kb.pageEncoding = httpCharset or metaCharset # Reference: http://bytes.com/topic/html-css/answers/154758-http-equiv-vs-true-header-has-precedence
305304
debugMsg = "declared web page charset '%s'" % kb.pageEncoding
306305
singleTimeLogMessage(debugMsg, logging.DEBUG, debugMsg)

txt/checksum.md5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ f872699e948d0692ce11b54781da814c lib/core/log.py
4646
760d9df2a27ded29109b390ab202e72d lib/core/replication.py
4747
a2466b62e67f8b31736bac4dac590e51 lib/core/revision.py
4848
02d4762140a72fd44668d3dab5eabda9 lib/core/session.py
49-
c56f644ba673e1ac93ba180b1283bcc1 lib/core/settings.py
49+
337545ac8dad16abc298b71b1d1c4364 lib/core/settings.py
5050
35bffbad762eb9e03db9e93b1c991103 lib/core/shell.py
5151
a59ec28371ae067a6fdd8f810edbee3d lib/core/subprocessng.py
5252
d93501771b41315f9fb949305b6ed257 lib/core/target.py
@@ -66,7 +66,7 @@ e07930095e56de11c297d7ac1a1706f2 lib/parse/html.py
6666
d8d9bcf9e7107a5e2cf2dd10f115ac28 lib/parse/payloads.py
6767
2b87577dc6d3609e96fc1e049def5b4f lib/parse/sitemap.py
6868
d2f13a0e2fef5273d419d06e516122e1 lib/request/basicauthhandler.py
69-
9ef264b5c0f9e7989b8c2ab91d40400d lib/request/basic.py
69+
4f8b3d682093fc577592e85999400149 lib/request/basic.py
7070
28348595147a731677c8bef470c6f57a lib/request/comparison.py
7171
ae823462aad7cd1081e6609192ba3109 lib/request/connect.py
7272
ad6f76839408d827abfcdc57813f8518 lib/request/direct.py

0 commit comments

Comments
 (0)