diff --git a/src/pretix/presale/checkoutflow.py b/src/pretix/presale/checkoutflow.py index 76c488624..e6ea9d372 100644 --- a/src/pretix/presale/checkoutflow.py +++ b/src/pretix/presale/checkoutflow.py @@ -51,6 +51,7 @@ from django.http import HttpResponseNotAllowed, JsonResponse from django.shortcuts import redirect from django.utils import translation from django.utils.functional import cached_property +from django.utils.html import conditional_escape from django.utils.translation import ( get_language, gettext_lazy as _, pgettext_lazy, ) @@ -1634,7 +1635,7 @@ class ConfirmStep(CartMixin, AsyncAction, TemplateFlowStep): meta_info = { 'contact_form_data': self.cart_session.get('contact_form_data', {}), 'confirm_messages': [ - str(m) for m in self.confirm_messages.values() + conditional_escape(str(m)) for m in self.confirm_messages.values() ] } api_meta = {} diff --git a/src/pretix/presale/signals.py b/src/pretix/presale/signals.py index 077b35d2c..7b5a0bf48 100644 --- a/src/pretix/presale/signals.py +++ b/src/pretix/presale/signals.py @@ -144,7 +144,7 @@ checkout_confirm_messages = EventPluginSignal() This signal is sent out to retrieve short messages that need to be acknowledged by the user before the order can be completed. This is typically used for something like "accept the terms and conditions". Receivers are expected to return a dictionary where the keys are globally unique identifiers for the -message and the values can be arbitrary HTML. +message and the values can be a SafeString containing arbitrary HTML, or a string that will be HTML-escaped. As with all event plugin signals, the ``sender`` keyword argument will contain the event. """ diff --git a/src/pretix/presale/templates/pretixpresale/event/checkout_confirm.html b/src/pretix/presale/templates/pretixpresale/event/checkout_confirm.html index 40db91acc..ad47ad429 100644 --- a/src/pretix/presale/templates/pretixpresale/event/checkout_confirm.html +++ b/src/pretix/presale/templates/pretixpresale/event/checkout_confirm.html @@ -176,7 +176,7 @@
{% endfor %}