diff --git a/utils.py b/utils.py index 6e291f1ae..0d85039cb 100644 --- a/utils.py +++ b/utils.py @@ -2536,3 +2536,15 @@ def getPortFromDomain(domain: str) -> int: if portStr.isdigit(): return int(portStr) return None + + +def validUrlPrefix(url: str) -> bool: + """Does the given url have a valid prefix? + """ + if '/' not in url: + return False + prefixes = ('https:', 'http:', 'hyper:', 'i2p:', 'gnunet:') + for pre in prefixes: + if url.startswith(pre): + return True + return False diff --git a/webapp_headerbuttons.py b/webapp_headerbuttons.py index 99ab01290..a50e01da6 100644 --- a/webapp_headerbuttons.py +++ b/webapp_headerbuttons.py @@ -54,8 +54,7 @@ def headerButtonsTimeline(defaultTimeline: str, # first button if defaultTimeline == 'tlmedia': tlStr += \ - '
' + \ '' + \ translate['You will become the admin of this site.'] + \ '
' @@ -132,8 +132,7 @@ def htmlLogin(cssCache: {}, translate: {}, TOSstr = \ '' + \ - translate['About this Instance'] + '
' - TOSstr += \ + translate['About this Instance'] + '' + \ '' + \ translate['Terms of Service'] + '
' @@ -153,34 +152,32 @@ def htmlLogin(cssCache: {}, translate: {}, htmlHeaderWithWebsiteMarkup(cssFilename, instanceTitle, httpPrefix, domain, systemLanguage) - loginForm += '