From ab56bf720aae37e189fb511c98d87f40d4c6c391 Mon Sep 17 00:00:00 2001 From: Oliver Falk Date: Mon, 22 Nov 2021 13:57:43 +0100 Subject: [PATCH] String search returns > 0 if found... --- ivatar/views.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ivatar/views.py b/ivatar/views.py index d892539..d1dcb4d 100644 --- a/ivatar/views.py +++ b/ivatar/views.py @@ -142,10 +142,12 @@ class AvatarImageView(TemplateView): # Check if default starts with an URL scheme and if it does, # check if it's trusted # 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 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 if "f" in request.GET: