main
Bob Mottram 2024-08-02 13:00:07 +01:00
parent e78da08e6e
commit 873f3748cd
2 changed files with 6 additions and 9 deletions

View File

@ -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

View File

@ -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'