Fixed passing UrlPattern Object into itself
This commit is contained in:
parent
8e42683f41
commit
ca0c892cbc
@ -27,9 +27,8 @@ import zipfile
|
|||||||
|
|
||||||
from qutebrowser.browser import downloads
|
from qutebrowser.browser import downloads
|
||||||
from qutebrowser.config import config
|
from qutebrowser.config import config
|
||||||
from qutebrowser.utils import objreg, standarddir, log, message
|
from qutebrowser.utils import objreg, standarddir, log, message, urlmatch
|
||||||
from qutebrowser.commands import cmdutils
|
from qutebrowser.commands import cmdutils
|
||||||
from qutebrowser.utils import urlmatch
|
|
||||||
|
|
||||||
|
|
||||||
def guess_zip_filename(zf):
|
def guess_zip_filename(zf):
|
||||||
@ -68,8 +67,11 @@ def is_whitelisted_host(url):
|
|||||||
url: The url to check in QUrl form.
|
url: The url to check in QUrl form.
|
||||||
"""
|
"""
|
||||||
for pattern in config.val.content.host_blocking.whitelist:
|
for pattern in config.val.content.host_blocking.whitelist:
|
||||||
if urlmatch.UrlPattern(pattern).matches(url):
|
try:
|
||||||
|
if pattern.matches(url):
|
||||||
return True
|
return True
|
||||||
|
except urlmatch.ParseError as p_error:
|
||||||
|
log.misc.exception("Unable to read UrlPattern: " + UrlPattern._pattern)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user