mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-03-03 19:55:47 +03:00
Fixes #3646
This commit is contained in:
parent
2d4ceaf527
commit
82f0f06b4b
|
@ -18,7 +18,7 @@ from lib.core.enums import OS
|
||||||
from thirdparty import six
|
from thirdparty import six
|
||||||
|
|
||||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||||
VERSION = "1.3.5.85"
|
VERSION = "1.3.5.86"
|
||||||
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)
|
||||||
|
|
30
thirdparty/clientform/clientform.py
vendored
30
thirdparty/clientform/clientform.py
vendored
|
@ -109,7 +109,7 @@ try:
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from lib.utils import sgmllib
|
from lib.utils import sgmllib
|
||||||
|
|
||||||
import sys, types, copy, re, random
|
import sys, re, random
|
||||||
|
|
||||||
if sys.version_info >= (3, 0):
|
if sys.version_info >= (3, 0):
|
||||||
xrange = range
|
xrange = range
|
||||||
|
@ -149,6 +149,14 @@ def compress_text(text): return _compress_re.sub(" ", text.strip())
|
||||||
def normalize_line_endings(text):
|
def normalize_line_endings(text):
|
||||||
return re.sub(r"(?:(?<!\r)\n)|(?:\r(?!\n))", "\r\n", text)
|
return re.sub(r"(?:(?<!\r)\n)|(?:\r(?!\n))", "\r\n", text)
|
||||||
|
|
||||||
|
def _quote_plus(value):
|
||||||
|
if not isinstance(value, six.string_types):
|
||||||
|
value = six.text_type(value)
|
||||||
|
|
||||||
|
if isinstance(value, six.text_type):
|
||||||
|
value = value.encode("utf8")
|
||||||
|
|
||||||
|
return _urllib.parse.quote_plus(value)
|
||||||
|
|
||||||
# This version of urlencode is from my Python 1.5.2 back-port of the
|
# This version of urlencode is from my Python 1.5.2 back-port of the
|
||||||
# Python 2.1 CVS maintenance branch of urllib. It will accept a sequence
|
# Python 2.1 CVS maintenance branch of urllib. It will accept a sequence
|
||||||
|
@ -190,20 +198,14 @@ string.
|
||||||
if not doseq:
|
if not doseq:
|
||||||
# preserve old behavior
|
# preserve old behavior
|
||||||
for k, v in query:
|
for k, v in query:
|
||||||
k = _urllib.parse.quote_plus(str(k))
|
k = _quote_plus(k)
|
||||||
v = _urllib.parse.quote_plus(str(v))
|
v = _quote_plus(v)
|
||||||
l.append(k + '=' + v)
|
l.append(k + '=' + v)
|
||||||
else:
|
else:
|
||||||
for k, v in query:
|
for k, v in query:
|
||||||
k = _urllib.parse.quote_plus(str(k))
|
k = _quote_plus(k)
|
||||||
if type(v) == types.StringType:
|
if isinstance(v, six.string_types):
|
||||||
v = _urllib.parse.quote_plus(v)
|
v = _quote_plus(v)
|
||||||
l.append(k + '=' + v)
|
|
||||||
elif type(v) == types.UnicodeType:
|
|
||||||
# is there a reasonable way to convert to ASCII?
|
|
||||||
# encode generates a string, but "replace" or "ignore"
|
|
||||||
# lose information and "strict" can raise UnicodeError
|
|
||||||
v = _urllib.parse.quote_plus(v.encode("ASCII","replace"))
|
|
||||||
l.append(k + '=' + v)
|
l.append(k + '=' + v)
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
|
@ -211,12 +213,12 @@ string.
|
||||||
x = len(v)
|
x = len(v)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
# not a sequence
|
# not a sequence
|
||||||
v = _urllib.parse.quote_plus(str(v))
|
v = _quote_plus(v)
|
||||||
l.append(k + '=' + v)
|
l.append(k + '=' + v)
|
||||||
else:
|
else:
|
||||||
# loop over the sequence
|
# loop over the sequence
|
||||||
for elt in v:
|
for elt in v:
|
||||||
l.append(k + '=' + _urllib.parse.quote_plus(str(elt)))
|
l.append(k + '=' + _quote_plus(elt))
|
||||||
return '&'.join(l)
|
return '&'.join(l)
|
||||||
|
|
||||||
def unescape(data, entities, encoding=DEFAULT_ENCODING):
|
def unescape(data, entities, encoding=DEFAULT_ENCODING):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user