mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-08-03 22:31:34 +00:00
Fixes #4017
This commit is contained in:
parent
9c87671e3a
commit
6e46624fe0
3 changed files with 10 additions and 5 deletions
|
|
@ -4360,11 +4360,16 @@ def asciifyUrl(url, forceQuote=False):
|
|||
if all(char in string.printable for char in url):
|
||||
return getText(url)
|
||||
|
||||
hostname = parts.hostname
|
||||
|
||||
if isinstance(hostname, six.binary_type):
|
||||
hostname = getUnicode(hostname)
|
||||
|
||||
# idna-encode domain
|
||||
try:
|
||||
hostname = parts.hostname.encode("idna")
|
||||
except LookupError:
|
||||
hostname = parts.hostname.encode("punycode")
|
||||
hostname = hostname.encode("idna")
|
||||
except:
|
||||
hostname = hostname.encode("punycode")
|
||||
|
||||
# UTF8-quote the other parts. We check each part individually if
|
||||
# if needs to be quoted - that should catch some additional user
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue