Fix #881 -- dont redirect tel scheme (#883)

This commit is contained in:
Felix Rindt
2018-04-24 17:20:47 +02:00
committed by Raphael Michel
parent 6df0597c5e
commit 9d2e2a1ea2

View File

@@ -63,7 +63,7 @@ ALLOWED_PROTOCOLS = ['http', 'https', 'mailto', 'tel']
def safelink_callback(attrs, new=False):
url = attrs.get((None, 'href'), '/')
if not is_safe_url(url) and not url.startswith('mailto:'):
if not is_safe_url(url) and not url.startswith('mailto:') and not url.startswith('tel:'):
signer = signing.Signer(salt='safe-redirect')
attrs[None, 'href'] = reverse('redirect') + '?url=' + urllib.parse.quote(signer.sign(url))
attrs[None, 'target'] = '_blank'