mirror of
https://github.com/pretix/pretix.git
synced 2026-05-07 15:34:02 +00:00
Fix HTML injection in error message (Z#23225396) (#5921)
We're not treating it as a security issue as there is no vector to inject the HTML into other people's browser, only one's own.
This commit is contained in:
@@ -870,11 +870,15 @@ class MailSettingsPreview(EventPermissionRequiredMixin, View):
|
|||||||
)
|
)
|
||||||
|
|
||||||
except ValueError:
|
except ValueError:
|
||||||
msgs[self.supported_locale[idx]] = '<div class="alert alert-danger">{}</div>'.format(
|
msgs[self.supported_locale[idx]] = format_html(
|
||||||
PlaceholderValidator.error_message)
|
'<div class="alert alert-danger">{}</div>',
|
||||||
|
PlaceholderValidator.error_message
|
||||||
|
)
|
||||||
except KeyError as e:
|
except KeyError as e:
|
||||||
msgs[self.supported_locale[idx]] = '<div class="alert alert-danger">{}</div>'.format(
|
msgs[self.supported_locale[idx]] = format_html(
|
||||||
_('Invalid placeholder: {%(value)s}') % {'value': e.args[0]})
|
'<div class="alert alert-danger">{}</div>',
|
||||||
|
_('Invalid placeholder: {%(value)s}') % {'value': e.args[0]}
|
||||||
|
)
|
||||||
|
|
||||||
return JsonResponse({
|
return JsonResponse({
|
||||||
'item': preview_item,
|
'item': preview_item,
|
||||||
|
|||||||
Reference in New Issue
Block a user