diff --git a/src/pretix/control/forms/event.py b/src/pretix/control/forms/event.py
index 377102bb3e..bb1f9f5f2b 100644
--- a/src/pretix/control/forms/event.py
+++ b/src/pretix/control/forms/event.py
@@ -838,9 +838,10 @@ class CancelSettingsForm(SettingsForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
if self.obj.settings.giftcard_expiry_years is not None:
- self.fields['cancel_allow_user_paid_refund_as_giftcard'].help_text = gettext(
- 'You have configured gift cards to be valid {} years plus the year the gift card is issued in.'
- ).format(self.obj.settings.giftcard_expiry_years)
+ self.fields['cancel_allow_user_paid_refund_as_giftcard'].help_text = format_html(
+ gettext('You have configured gift cards to be valid {} years plus the year the gift card is issued in.'),
+ self.obj.settings.giftcard_expiry_years
+ )
class PaymentSettingsForm(EventSettingsValidationMixin, SettingsForm):
diff --git a/src/pretix/control/forms/modelimport.py b/src/pretix/control/forms/modelimport.py
index 9e6c4869fc..656f16b4ff 100644
--- a/src/pretix/control/forms/modelimport.py
+++ b/src/pretix/control/forms/modelimport.py
@@ -22,7 +22,7 @@
from django import forms
from django.core.exceptions import ValidationError
from django.utils.functional import lazy
-from django.utils.html import format_html
+from django.utils.html import conditional_escape, format_html
from django.utils.translation import gettext_lazy as _
from pretix.base.modelimport_orders import get_order_import_columns
@@ -66,7 +66,7 @@ class ProcessForm(forms.Form):
widget=forms.Select(
attrs={'data-static': 'true'}
),
- help_text=c.help_text,
+ help_text=conditional_escape(c.help_text),
)
def get_columns(self):
diff --git a/src/pretix/control/forms/organizer.py b/src/pretix/control/forms/organizer.py
index 2bafd2d420..188bdab039 100644
--- a/src/pretix/control/forms/organizer.py
+++ b/src/pretix/control/forms/organizer.py
@@ -364,7 +364,7 @@ class TeamForm(forms.ModelForm):
for opt in pg.options
],
label=pg.label,
- help_text=pg.help_text,
+ help_text=conditional_escape(pg.help_text),
initial=initial,
widget=forms.RadioSelect,
)
@@ -389,7 +389,7 @@ class TeamForm(forms.ModelForm):
for opt in pg.options
],
label=pg.label,
- help_text=pg.help_text,
+ help_text=conditional_escape(pg.help_text),
initial=initial,
widget=forms.RadioSelect,
)
diff --git a/src/pretix/control/forms/vouchers.py b/src/pretix/control/forms/vouchers.py
index e8bf6fac98..aac75b26e5 100644
--- a/src/pretix/control/forms/vouchers.py
+++ b/src/pretix/control/forms/vouchers.py
@@ -44,6 +44,7 @@ from django.db.models import Count, F, Max
from django.db.models.functions import Upper
from django.forms.utils import ErrorDict
from django.urls import reverse
+from django.utils.html import escape
from django.utils.timezone import now
from django.utils.translation import gettext_lazy as _, pgettext_lazy
from django_scopes.forms import SafeModelChoiceField
@@ -176,7 +177,7 @@ class VoucherForm(I18nModelForm):
required=False,
widget=forms.TextInput(attrs={'data-seat-guid-field': '1'}),
initial=self.instance.seat.seat_guid if self.instance.seat else '',
- help_text=str(self.instance.seat) if self.instance.seat else '',
+ help_text=escape(str(self.instance.seat) if self.instance.seat else ''),
)
def parse_itemvar(self, data):
diff --git a/src/pretix/presale/forms/customer.py b/src/pretix/presale/forms/customer.py
index f301a03801..97ea9995c3 100644
--- a/src/pretix/presale/forms/customer.py
+++ b/src/pretix/presale/forms/customer.py
@@ -30,7 +30,8 @@ from django.contrib.auth.password_validation import (
)
from django.contrib.auth.tokens import PasswordResetTokenGenerator
from django.core import signing
-from django.utils.html import escape
+from django.utils.functional import cached_property
+from django.utils.html import escape, format_html
from django.utils.translation import gettext_lazy as _
from phonenumber_field.formfields import PhoneNumberField
@@ -81,7 +82,8 @@ class AuthenticationForm(forms.Form):
self.request = request
self.customer_cache = None
super().__init__(*args, **kwargs)
- self.fields['password'].help_text = "{}".format(
+ self.fields['password'].help_text = format_html(
+ "{}",
eventreverse_absolute(False, 'presale:organizer.customer.resetpw', kwargs={
'organizer': request.organizer.slug,
}),