Don't handle hexadecimal numbers as IP addresses.

Fixes #269.
This commit is contained in:
Florian Bruhin 2014-11-24 21:47:22 +01:00
parent a8c1273682
commit 7be32dd70c

View File

@ -85,9 +85,10 @@ def _is_url_naive(urlstr):
else:
# Valid IPv4/IPv6 address
return True
if re.search(r'^[0-9.]+$', urlstr):
# Qt treats things like "23.42" or "1337" as valid URLs which we don't
# want to. Note we already filtered *real* valid IPs above.
if re.search(r'^([0-9.]+|0x[a-fA-F0-9]+)$', urlstr):
# Qt treats things like "23.42" or "1337" or "0xDEAD" as valid URLs
# which we don't want to. Note we already filtered *real* valid IPs
# above.
return False
elif not url.isValid():
return False