Removes potential '//' from email links (#420)

If the user specifies a public endpoint as `http[s]://comments.exemple.com/` in configuration, the trailing slash will involve a `//` in the generated email links.
master
Samuel FORESTIER 5 years ago committed by GitHub
parent 784e08170a
commit 1a3f803b96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -77,6 +77,8 @@ class SMTP(object):
self.isso = isso
self.conf = isso.conf.section("smtp")
self.public_endpoint = isso.conf.get("server", "public-endpoint") or local("host")
if self.public_endpoint.endswith('/'):
self.public_endpoint = self.public_endpoint.rstrip('/')
self.admin_notify = any((n in ("smtp", "SMTP")) for n in isso.conf.getlist("general", "notify"))
self.reply_notify = isso.conf.getboolean("general", "reply-notifications")

Loading…
Cancel
Save