fix: remove surplus %20 and + from links to twitter and email (#26393)

This commit is contained in:
Maarten
2021-02-19 21:02:22 +01:00
committed by GitHub
parent 85242014b6
commit ae3130b960

View File

@@ -32,8 +32,9 @@ from six import text_type
domain=site_domain,
path=reverse('about_course', args=[text_type(course.id)])
)
).replace(u" ", u"+")
tweet_action = u"http://twitter.com/intent/tweet?text={tweet_text}".format(tweet_text=six.moves.urllib.parse.quote_plus(tweet_text.encode('UTF-8')))
)
tweet_action = u"https://twitter.com/intent/tweet?text={tweet_text}".format(tweet_text=six.moves.urllib.parse.quote(tweet_text))
facebook_link = static.get_value('course_about_facebook_link', settings.PLATFORM_FACEBOOK_ACCOUNT)
@@ -46,12 +47,12 @@ from six import text_type
domain=site_domain,
path=reverse('about_course', args=[text_type(course.id)]),
)
).replace(u" ", u"%20")
)
email_subject = _("Take a course with {platform} online").format(platform=platform_name)
email_link = u"mailto:?subject={subject}&body={body}".format(
subject=six.moves.urllib.parse.quote_plus(email_subject.encode('UTF-8')),
body=six.moves.urllib.parse.quote_plus(email_body.encode('UTF-8'))
subject=six.moves.urllib.parse.quote(email_subject.encode('UTF-8')),
body=six.moves.urllib.parse.quote(email_body.encode('UTF-8'))
)
%>
<a href="${tweet_action}" class="share">