diff --git a/httpheaders.py b/httpheaders.py index 4f3a90785..15b74278e 100644 --- a/httpheaders.py +++ b/httpheaders.py @@ -237,8 +237,7 @@ def contains_suspicious_headers(headers: {}) -> bool: 'Think-lang' in headers: return True headers_str = str(headers) - if '../../' in headers_str or \ - 'index.php' in headers_str or \ - 'passwd' in headers_str: + sus_strings = ('../../', 'index.php', 'passwd') + if string_contains(headers_str, sus_strings): return True return False diff --git a/utils.py b/utils.py index 242ab47af..3b7f527cd 100644 --- a/utils.py +++ b/utils.py @@ -5062,13 +5062,11 @@ def license_link_from_name(license_name: str) -> str: if '://' in license_name: return license_name value_upper = license_name.upper() - if 'CC-BY-SA-NC' in value_upper or \ - 'CC-BY-NC-SA' in value_upper or \ - 'CC BY SA NC' in value_upper or \ - 'CC BY NC SA' in value_upper: + cc_strings1 = ('CC-BY-SA-NC', 'CC-BY-NC-SA', 'CC BY SA NC', 'CC BY NC SA') + cc_strings2 = ('CC-BY-SA', 'CC-SA-BY', 'CC BY SA', 'CC SA BY') + if string_contains(value_upper, cc_strings1): value = 'https://creativecommons.org/licenses/by-nc-sa/4.0' - elif 'CC-BY-SA' in value_upper or 'CC-SA-BY' in value_upper or \ - 'CC BY SA' in value_upper or 'CC SA BY' in value_upper: + elif string_contains(value_upper, cc_strings2): value = 'https://creativecommons.org/licenses/by-sa/4.0' elif 'CC-BY-NC' in value_upper or 'CC BY NC' in value_upper: value = 'https://creativecommons.org/licenses/by-nc/4.0'