String search returns > 0 if found...

This commit is contained in:
Oliver Falk
2021-11-22 13:57:43 +01:00
parent 56f90412bf
commit ab56bf720a

View File

@@ -142,10 +142,12 @@ class AvatarImageView(TemplateView):
# Check if default starts with an URL scheme and if it does, # Check if default starts with an URL scheme and if it does,
# check if it's trusted # check if it's trusted
# Check for :// (schema) # Check for :// (schema)
if default is not None and default.find("://"): if default is not None and default.find("://") > 0:
# Check if it's trusted, if not, reset to None # Check if it's trusted, if not, reset to None
if not any(x in default for x in TRUSTED_DEFAULT_URLS): if not any(x in default for x in TRUSTED_DEFAULT_URLS):
print("Default URL is not in trusted URLs. Kicking it!") print(
"Default URL is not in trusted URLs: '%s' ; Kicking it!" % default
)
default = None default = None
if "f" in request.GET: if "f" in request.GET: