diff options
author | Aurélien Bompard <aurelien@bompard.org> | 2012-10-29 14:54:17 +0100 |
---|---|---|
committer | Aurélien Bompard <aurelien@bompard.org> | 2012-10-29 14:54:17 +0100 |
commit | 133172ba8823c689bdfa529ff02c5e2c72fca2a4 (patch) | |
tree | 6c601997056c39f0bf775f5e71f346afe4396920 | |
parent | 34b100adc0bf61a31a2fc9771869b26f6be2478d (diff) | |
download | hyperkitty-133172ba8823c689bdfa529ff02c5e2c72fca2a4.tar.gz hyperkitty-133172ba8823c689bdfa529ff02c5e2c72fca2a4.tar.xz hyperkitty-133172ba8823c689bdfa529ff02c5e2c72fca2a4.zip |
Escape @-signs
-rw-r--r-- | hyperkitty/templates/month_view.html | 4 | ||||
-rw-r--r-- | hyperkitty/templatetags/hk_generic.py | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/hyperkitty/templates/month_view.html b/hyperkitty/templates/month_view.html index 9f3a857..00b7a96 100644 --- a/hyperkitty/templates/month_view.html +++ b/hyperkitty/templates/month_view.html @@ -8,7 +8,7 @@ <div id="month-view"> <header> - <div class="list-name">{{ mlist.display_name|default:mlist.name }}</div> + <div class="list-name">{{ mlist.display_name|default:mlist.name|escapeatsign }}</div> <div class="month-name">{{ month|date:"F Y"|capfirst }}</div> <ul class="month-info"> <li class="participant"> @@ -20,7 +20,7 @@ </ul> {% if mlist.display_name %} <p class="list-address"> - <a href="mailto:{{ list_address }}">{{ list_address }}</a> + <a href="mailto:{{ list_address|escapeatsign }}">{{ list_address|escapeatsign }}</a> </p> {% endif %} </header> diff --git a/hyperkitty/templatetags/hk_generic.py b/hyperkitty/templatetags/hk_generic.py index 5f30bc2..d7e3d2c 100644 --- a/hyperkitty/templatetags/hk_generic.py +++ b/hyperkitty/templatetags/hk_generic.py @@ -90,3 +90,10 @@ def truncatesmart(value, limit=80): # Join the words and return return ' '.join(words) + '...' + + +@register.filter(is_safe=True) +def escapeatsign(text): + """To escape email addresses""" + return text.replace("@", u"\uff20") + |