From ae3130b9605588a48ca113385144ec8bc1c5d94b Mon Sep 17 00:00:00 2001 From: Maarten Date: Fri, 19 Feb 2021 21:02:22 +0100 Subject: [PATCH] fix: remove surplus %20 and + from links to twitter and email (#26393) --- .../courseware/course_about_sidebar_header.html | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lms/templates/courseware/course_about_sidebar_header.html b/lms/templates/courseware/course_about_sidebar_header.html index d58d8a1b88..a877e90aba 100644 --- a/lms/templates/courseware/course_about_sidebar_header.html +++ b/lms/templates/courseware/course_about_sidebar_header.html @@ -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')) ) %>