mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-03 05:04:11 +03:00
"patch" for a problem reported by black zero (v = self._sslobj.write(data)...UnicodeError)
This commit is contained in:
parent
96c3ffd3d7
commit
93838fb155
|
@ -1892,3 +1892,15 @@ def filterListValue(value, regex):
|
||||||
return retVal
|
return retVal
|
||||||
else:
|
else:
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
def unicodeToSafeHTMLValue(value):
|
||||||
|
"""
|
||||||
|
Returns HTML representation of unicode
|
||||||
|
string value safe for sending over HTTP(s)
|
||||||
|
"""
|
||||||
|
retVal = value
|
||||||
|
if value:
|
||||||
|
for char in value:
|
||||||
|
if ord(char) > 127:
|
||||||
|
retVal = retVal.replace(char, "&#%d;" % ord(char))
|
||||||
|
return retVal
|
||||||
|
|
|
@ -22,6 +22,7 @@ from lib.core.common import calculateDeltaSeconds
|
||||||
from lib.core.common import clearConsoleLine
|
from lib.core.common import clearConsoleLine
|
||||||
from lib.core.common import getCurrentThreadData
|
from lib.core.common import getCurrentThreadData
|
||||||
from lib.core.common import getFilteredPageContent
|
from lib.core.common import getFilteredPageContent
|
||||||
|
from lib.core.common import unicodeToSafeHTMLValue
|
||||||
from lib.core.common import getUnicode
|
from lib.core.common import getUnicode
|
||||||
from lib.core.common import logHTTPTraffic
|
from lib.core.common import logHTTPTraffic
|
||||||
from lib.core.common import readInput
|
from lib.core.common import readInput
|
||||||
|
@ -150,6 +151,11 @@ class Connect:
|
||||||
for key, item in auxHeaders.items():
|
for key, item in auxHeaders.items():
|
||||||
headers[key] = item
|
headers[key] = item
|
||||||
|
|
||||||
|
for key, item in headers.items():
|
||||||
|
headers[key] = unicodeToSafeHTMLValue(item)
|
||||||
|
|
||||||
|
post = unicodeToSafeHTMLValue(post)
|
||||||
|
|
||||||
if method:
|
if method:
|
||||||
req = MethodRequest(url, post, headers)
|
req = MethodRequest(url, post, headers)
|
||||||
req.set_method(method)
|
req.set_method(method)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user