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

Skip to content

Commit a8c3d17

Browse files
committed
Fixes #4197
1 parent 3c36b18 commit a8c3d17

2 files changed

Lines changed: 8 additions & 12 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.5.10"
21+
VERSION = "1.4.5.11"
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)

thirdparty/clientform/clientform.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,9 @@ def replace_entities(match, entities=entities, encoding=encoding):
237237

238238
repl = entities.get(ent)
239239
if repl is not None:
240-
if type(repl) != type("") and encoding is not None:
240+
if hasattr(repl, "decode") and encoding is not None:
241241
try:
242-
repl = repl.encode(encoding)
242+
repl = repl.decode(encoding)
243243
except UnicodeError:
244244
repl = ent
245245
else:
@@ -255,15 +255,11 @@ def unescape_charref(data, encoding):
255255
name, base= name[1:], 16
256256
elif not name.isdigit():
257257
base = 16
258-
uc = _unichr(int(name, base))
259-
if encoding is None:
260-
return uc
261-
else:
262-
try:
263-
repl = uc.encode(encoding)
264-
except UnicodeError:
265-
repl = "&#%s;" % data
266-
return repl
258+
259+
try:
260+
return _unichr(int(name, base))
261+
except:
262+
return data
267263

268264
def get_entitydefs():
269265
from codecs import latin_1_decode

0 commit comments

Comments
 (0)