1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-09 00:40:11 +01:00

Detect most bad URLs

Also [appid] links that should really be [[appid]]
This commit is contained in:
Daniel Martí 2015-05-13 13:05:42 +02:00
parent bd3303c43d
commit dd70c9441c

View File

@ -339,6 +339,8 @@ class DescriptionFormatter:
else: else:
urltxt = url[index2 + 1:] urltxt = url[index2 + 1:]
url = url[:index2] url = url[:index2]
if ':' not in url:
raise MetaDataException("'%s' doesn't look like an URL" % url)
linkified_html += '<a href="' + url + '">' + cgi.escape(urltxt) + '</a>' linkified_html += '<a href="' + url + '">' + cgi.escape(urltxt) + '</a>'
linkified_plain += urltxt linkified_plain += urltxt
if urltxt != url: if urltxt != url: