urlmatch: Make sure URLs are valid
This commit is contained in:
parent
0a10a4f751
commit
a2836ba945
@ -30,7 +30,7 @@ import fnmatch
|
|||||||
import contextlib
|
import contextlib
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
|
|
||||||
from qutebrowser.utils import utils
|
from qutebrowser.utils import utils, qtutils
|
||||||
|
|
||||||
|
|
||||||
class ParseError(Exception):
|
class ParseError(Exception):
|
||||||
@ -236,6 +236,8 @@ class UrlPattern:
|
|||||||
|
|
||||||
def matches(self, qurl):
|
def matches(self, qurl):
|
||||||
"""Check if the pattern matches the given QUrl."""
|
"""Check if the pattern matches the given QUrl."""
|
||||||
|
qtutils.ensure_valid(qurl)
|
||||||
|
|
||||||
# FIXME do we need to check this early?
|
# FIXME do we need to check this early?
|
||||||
if not self._matches_scheme(qurl.scheme()):
|
if not self._matches_scheme(qurl.scheme()):
|
||||||
return False
|
return False
|
||||||
|
Loading…
Reference in New Issue
Block a user