Verified Commit 957404a9 authored by Baptiste Beauplat's avatar Baptiste Beauplat
Browse files

Unescape html before urlencode in mailto link for RFS template (Closes: #90)

parent e0eb7a26
...@@ -42,6 +42,7 @@ import struct ...@@ -42,6 +42,7 @@ import struct
import socket import socket
import json import json
import urllib import urllib
from HTMLParser import HTMLParser
from debexpo.lib.base import BaseController, c, config, render, session, \ from debexpo.lib.base import BaseController, c, config, render, session, \
redirect, url, abort, request, SubMenu, _ redirect, url, abort, request, SubMenu, _
...@@ -327,7 +328,8 @@ class SponsorController(BaseController): ...@@ -327,7 +328,8 @@ class SponsorController(BaseController):
# This is a workaround for Thunderbird and some other clients # This is a workaround for Thunderbird and some other clients
# not handling properly '+' in the mailto body parameter. # not handling properly '+' in the mailto body parameter.
c.mailbody = render('/sponsor/rfs_template.mako') c.mailbody = render('/sponsor/rfs_template.mako')
c.mailbody = urllib.quote_plus(c.mailbody.encode('utf-8')) \ c.mailbody = urllib.quote_plus(HTMLParser().unescape(
unicode(c.mailbody)).encode('utf-8')) \
.replace('+', '%20') .replace('+', '%20')
return render('/sponsor/rfs_howto.mako') return render('/sponsor/rfs_howto.mako')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment