mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-05-03 15:23:44 +03:00
Patch regarding #4066
This commit is contained in:
parent
71b33e5956
commit
eb3a3b4825
|
@ -227,7 +227,7 @@ def encodeBase64(value, binary=True, encoding=None):
|
||||||
|
|
||||||
return retVal
|
return retVal
|
||||||
|
|
||||||
def getBytes(value, encoding=UNICODE_ENCODING, errors="strict", unsafe=True):
|
def getBytes(value, encoding=None, errors="strict", unsafe=True):
|
||||||
"""
|
"""
|
||||||
Returns byte representation of provided Unicode value
|
Returns byte representation of provided Unicode value
|
||||||
|
|
||||||
|
@ -237,9 +237,12 @@ def getBytes(value, encoding=UNICODE_ENCODING, errors="strict", unsafe=True):
|
||||||
|
|
||||||
retVal = value
|
retVal = value
|
||||||
|
|
||||||
|
if encoding is None:
|
||||||
|
encoding = conf.encoding or UNICODE_ENCODING
|
||||||
|
|
||||||
try:
|
try:
|
||||||
codecs.lookup(encoding)
|
codecs.lookup(encoding)
|
||||||
except LookupError:
|
except (LookupError, TypeError):
|
||||||
encoding = UNICODE_ENCODING
|
encoding = UNICODE_ENCODING
|
||||||
|
|
||||||
if isinstance(value, six.text_type):
|
if isinstance(value, six.text_type):
|
||||||
|
|
|
@ -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.1.19"
|
VERSION = "1.4.1.20"
|
||||||
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)
|
||||||
|
|
|
@ -26,6 +26,6 @@ class Syntax(GenericSyntax):
|
||||||
if all(_ < 128 for _ in getOrds(value)):
|
if all(_ < 128 for _ in getOrds(value)):
|
||||||
return "0x%s" % getUnicode(binascii.hexlify(getBytes(value)))
|
return "0x%s" % getUnicode(binascii.hexlify(getBytes(value)))
|
||||||
else:
|
else:
|
||||||
return "CONVERT(0x%s USING utf8)" % getUnicode(binascii.hexlify(getBytes(value)))
|
return "CONVERT(0x%s USING utf8)" % getUnicode(binascii.hexlify(getBytes(value, "utf8")))
|
||||||
|
|
||||||
return Syntax._escape(expression, quote, escaper)
|
return Syntax._escape(expression, quote, escaper)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user