diff --git a/lib/core/settings.py b/lib/core/settings.py index b465047cb..b4bcb67da 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -18,7 +18,7 @@ from lib.core.enums import OS from thirdparty.six import unichr as _unichr # sqlmap version (...) -VERSION = "1.4.5.10" +VERSION = "1.4.5.11" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" 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) diff --git a/thirdparty/clientform/clientform.py b/thirdparty/clientform/clientform.py index 48f897a9b..f4bd651d5 100644 --- a/thirdparty/clientform/clientform.py +++ b/thirdparty/clientform/clientform.py @@ -237,9 +237,9 @@ def unescape(data, entities, encoding=DEFAULT_ENCODING): repl = entities.get(ent) if repl is not None: - if type(repl) != type("") and encoding is not None: + if hasattr(repl, "decode") and encoding is not None: try: - repl = repl.encode(encoding) + repl = repl.decode(encoding) except UnicodeError: repl = ent else: @@ -255,15 +255,11 @@ def unescape_charref(data, encoding): name, base= name[1:], 16 elif not name.isdigit(): base = 16 - uc = _unichr(int(name, base)) - if encoding is None: - return uc - else: - try: - repl = uc.encode(encoding) - except UnicodeError: - repl = "&#%s;" % data - return repl + + try: + return _unichr(int(name, base)) + except: + return data def get_entitydefs(): from codecs import latin_1_decode