From 577bf923c1108a84af563913e83884c72176d563 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 30 Aug 2024 12:02:06 +0100 Subject: [PATCH] Less indentation --- content.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/content.py b/content.py index 5a9aff9bf..13014f77d 100644 --- a/content.py +++ b/content.py @@ -274,13 +274,15 @@ def dangerous_css(filename: str, allow_local_network_access: bool) -> bool: url_list = content.split('url(') ctr = 0 for url_str in url_list: - if ctr > 0: - if ')' in url_str: - url_str = url_str.split(')')[0] - if string_contains(url_str, ('http', 'ipfs', 'ipns')): - print('ERROR: non-local web link in CSS ' + - filename) - return True + if ctr == 0: + ctr = 1 + continue + if ')' in url_str: + url_str = url_str.split(')')[0] + if string_contains(url_str, ('http', 'ipfs', 'ipns')): + print('ERROR: non-local web link in CSS ' + + filename) + return True ctr += 1 # an attacker can include html inside of the css