mirror of
https://git.linux-kernel.at/oliver/ivatar.git
synced 2025-11-11 18:56:23 +00:00
Filter is a reserved word
This commit is contained in:
@@ -217,33 +217,33 @@ def is_trusted_url(url, url_filters):
|
|||||||
"""
|
"""
|
||||||
(scheme, netloc, path, params, query, fragment) = urlparse(url)
|
(scheme, netloc, path, params, query, fragment) = urlparse(url)
|
||||||
|
|
||||||
for filter in url_filters:
|
for ufilter in url_filters:
|
||||||
if "schemes" in filter:
|
if "schemes" in ufilter:
|
||||||
schemes = filter["schemes"]
|
schemes = ufilter["schemes"]
|
||||||
|
|
||||||
if scheme not in schemes:
|
if scheme not in schemes:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if "host_equals" in filter:
|
if "host_equals" in ufilter:
|
||||||
host_equals = filter["host_equals"]
|
host_equals = ufilter["host_equals"]
|
||||||
|
|
||||||
if netloc != host_equals:
|
if netloc != host_equals:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if "host_suffix" in filter:
|
if "host_suffix" in ufilter:
|
||||||
host_suffix = filter["host_suffix"]
|
host_suffix = ufilter["host_suffix"]
|
||||||
|
|
||||||
if not netloc.endswith(host_suffix):
|
if not netloc.endswith(host_suffix):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if "path_prefix" in filter:
|
if "path_prefix" in ufilter:
|
||||||
path_prefix = filter["path_prefix"]
|
path_prefix = ufilter["path_prefix"]
|
||||||
|
|
||||||
if not path.startswith(path_prefix):
|
if not path.startswith(path_prefix):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if "url_prefix" in filter:
|
if "url_prefix" in ufilter:
|
||||||
url_prefix = filter["url_prefix"]
|
url_prefix = ufilter["url_prefix"]
|
||||||
|
|
||||||
if not url.startswith(url_prefix):
|
if not url.startswith(url_prefix):
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user