diff --git a/src/pretix/base/payment.py b/src/pretix/base/payment.py index 9c463eb94..c8047bbd5 100644 --- a/src/pretix/base/payment.py +++ b/src/pretix/base/payment.py @@ -936,7 +936,7 @@ class BasePaymentProvider: """ Will be called if the *event administrator* views the details of a payment. - It should return HTML code containing information regarding the current payment + It should return a SafeString containing HTML code, with information regarding the current payment status and, if applicable, next steps. The default implementation returns an empty string. @@ -961,7 +961,7 @@ class BasePaymentProvider: """ Will be called if the *event administrator* views the details of a refund. - It should return HTML code containing information regarding the current refund + It should return a SafeString containing HTML code, with information regarding the current refund status and, if applicable, next steps. The default implementation returns an empty string. diff --git a/src/pretix/control/templates/pretixcontrol/auth/login_2fa.html b/src/pretix/control/templates/pretixcontrol/auth/login_2fa.html index 760769b3a..d5370a45a 100644 --- a/src/pretix/control/templates/pretixcontrol/auth/login_2fa.html +++ b/src/pretix/control/templates/pretixcontrol/auth/login_2fa.html @@ -3,6 +3,7 @@ {% load i18n %} {% load static %} {% load compress %} +{% load escapejson %} {% block content %}
{% csrf_token %} @@ -30,8 +31,7 @@
{% if jsondata %} {% endif %} {% compress js %} diff --git a/src/pretix/control/templates/pretixcontrol/order/cancel.html b/src/pretix/control/templates/pretixcontrol/order/cancel.html index 158cce737..f4a404042 100644 --- a/src/pretix/control/templates/pretixcontrol/order/cancel.html +++ b/src/pretix/control/templates/pretixcontrol/order/cancel.html @@ -2,6 +2,7 @@ {% load i18n %} {% load bootstrap3 %} {% load money %} +{% load wrap_in %} {% block title %} {% trans "Cancel order" %} {% endblock %} @@ -26,7 +27,7 @@ {% if form.cancellation_fee %} {% if fee %} {% with fee|money:request.event.currency as f %} -

{% blocktrans trimmed with fee=""|add:f|add:""|safe %} +

{% blocktrans trimmed with fee=f|wrap_in:"strong" %} The configured cancellation fee for a self-service cancellation would be {{ fee }} for this order, but for a cancellation performed by you, you need to set the cancellation fee here: {% endblocktrans %}

diff --git a/src/pretix/control/templates/pretixcontrol/order/index.html b/src/pretix/control/templates/pretixcontrol/order/index.html index 352877761..cdba94c04 100644 --- a/src/pretix/control/templates/pretixcontrol/order/index.html +++ b/src/pretix/control/templates/pretixcontrol/order/index.html @@ -903,7 +903,7 @@ - {{ p.html_info|safe }} + {{ p.html_info }} {% if staff_session %}

@@ -1018,7 +1018,7 @@ {% endif %} {% if r.html_info %} - {{ r.html_info|safe }} + {{ r.html_info }} {% endif %} {% if staff_session %}

diff --git a/src/pretix/control/templates/pretixcontrol/organizers/device_connect.html b/src/pretix/control/templates/pretixcontrol/organizers/device_connect.html index 63ba0d201..5f933b301 100644 --- a/src/pretix/control/templates/pretixcontrol/organizers/device_connect.html +++ b/src/pretix/control/templates/pretixcontrol/organizers/device_connect.html @@ -2,6 +2,7 @@ {% load i18n %} {% load static %} {% load bootstrap3 %} +{% load escapejson %} {% block inner %}

{% trans "Connect to device:" %} {{ device.name }}

@@ -18,7 +19,7 @@ {% trans "Open the app that you want to connect and optionally reset it to the original state." %}
  • {% trans "Scan the following configuration code:" %}

    -
    +
    {% trans "If your app/device does not support scanning a QR code, you can also enter the following information:" %}
    {% trans "System URL:" %} {{ settings.SITE_URL }} diff --git a/src/pretix/control/templates/pretixcontrol/user/2fa_confirm_totp.html b/src/pretix/control/templates/pretixcontrol/user/2fa_confirm_totp.html index a25ca03cf..a0b4489f3 100644 --- a/src/pretix/control/templates/pretixcontrol/user/2fa_confirm_totp.html +++ b/src/pretix/control/templates/pretixcontrol/user/2fa_confirm_totp.html @@ -1,6 +1,7 @@ {% extends "pretixcontrol/base.html" %} {% load i18n %} {% load bootstrap3 %} +{% load escapejson %} {% block title %}{% trans "Add a two-factor authentication device" %}{% endblock %} {% block content %}

    {% trans "Add a two-factor authentication device" %}

    @@ -32,7 +33,7 @@
  • {% trans "Add a new account to the app by scanning the following barcode:" %} -
    +

    {% trans "Can't scan the barcode?" %} @@ -81,9 +82,4 @@

  • - {% endblock %} diff --git a/src/pretix/control/templates/pretixcontrol/user/2fa_confirm_webauthn.html b/src/pretix/control/templates/pretixcontrol/user/2fa_confirm_webauthn.html index 1b064b8aa..f03b03fe5 100644 --- a/src/pretix/control/templates/pretixcontrol/user/2fa_confirm_webauthn.html +++ b/src/pretix/control/templates/pretixcontrol/user/2fa_confirm_webauthn.html @@ -3,6 +3,7 @@ {% load bootstrap3 %} {% load static %} {% load compress %} +{% load escapejson %} {% block title %}{% trans "Add a two-factor authentication device" %}{% endblock %} {% block content %}

    {% trans "Add a two-factor authentication device" %}

    @@ -26,9 +27,7 @@ {% trans "Device registration failed." %} {% compress js %} diff --git a/src/pretix/control/templates/pretixcontrol/user/reauth.html b/src/pretix/control/templates/pretixcontrol/user/reauth.html index 797e5ef58..caa61ed0a 100644 --- a/src/pretix/control/templates/pretixcontrol/user/reauth.html +++ b/src/pretix/control/templates/pretixcontrol/user/reauth.html @@ -3,6 +3,7 @@ {% load bootstrap3 %} {% load compress %} {% load static %} +{% load escapejson %} {% block content %}
    {% csrf_token %} @@ -43,7 +44,7 @@ {% if jsondata %} {% endif %} {% compress js %} diff --git a/src/pretix/control/views/orders.py b/src/pretix/control/views/orders.py index 3b8cd26e6..8245d78ed 100644 --- a/src/pretix/control/views/orders.py +++ b/src/pretix/control/views/orders.py @@ -551,10 +551,10 @@ class OrderDetail(OrderView): ctx['refunds'] = self.order.refunds.select_related('payment').order_by('-created') for p in ctx['payments']: if p.payment_provider: - p.html_info = (p.payment_provider.payment_control_render(self.request, p) or "").strip() + p.html_info = p.payment_provider.payment_control_render(self.request, p) or "" for r in ctx['refunds']: if r.payment_provider: - r.html_info = (r.payment_provider.refund_control_render(self.request, r) or "").strip() + r.html_info = r.payment_provider.refund_control_render(self.request, r) or "" ctx['invoices'] = list(self.order.invoices.all().select_related('event')) ctx['comment_form'] = CommentForm(initial={ 'comment': self.order.comment, diff --git a/src/pretix/helpers/escapejson.py b/src/pretix/helpers/escapejson.py index 1df8cd168..d5dd9f6c9 100644 --- a/src/pretix/helpers/escapejson.py +++ b/src/pretix/helpers/escapejson.py @@ -47,5 +47,5 @@ def escapejson(value): @keep_lazy(str, SafeText) def escapejson_attr(value): - """Hex encodes characters for use in a html attributw script.""" + """Hex encodes characters for use in a html attribute.""" return mark_safe(force_str(value).translate(_json_escapes_attr)) diff --git a/src/pretix/plugins/stripe/static/pretixplugins/stripe/pretix-stripe.js b/src/pretix/plugins/stripe/static/pretixplugins/stripe/pretix-stripe.js index cf71266f8..8aaf94267 100644 --- a/src/pretix/plugins/stripe/static/pretixplugins/stripe/pretix-stripe.js +++ b/src/pretix/plugins/stripe/static/pretixplugins/stripe/pretix-stripe.js @@ -323,7 +323,7 @@ $(function () { } } } else if ($("#stripe_payment_intent_next_action_redirect_url").length) { - let payment_intent_next_action_redirect_url = $.trim($("#stripe_payment_intent_next_action_redirect_url").html()); + let payment_intent_next_action_redirect_url = JSON.parse($("#stripe_payment_intent_next_action_redirect_url").html()); pretixstripe.handlePaymentRedirectAction(payment_intent_next_action_redirect_url); } else if ($.trim($("#stripe_payment_intent_action_type").html()) === "promptpay_display_qr_code") { waitingDialog.hide(); @@ -432,4 +432,4 @@ $(function () { } } ); -}); \ No newline at end of file +}); diff --git a/src/pretix/plugins/stripe/templates/pretixplugins/stripe/sca.html b/src/pretix/plugins/stripe/templates/pretixplugins/stripe/sca.html index 7f4cd530c..9182be6d3 100644 --- a/src/pretix/plugins/stripe/templates/pretixplugins/stripe/sca.html +++ b/src/pretix/plugins/stripe/templates/pretixplugins/stripe/sca.html @@ -9,7 +9,7 @@ {% if payment_intent_next_action_redirect_url %} - + {{ payment_intent_next_action_redirect_url|json_script:"stripe_payment_intent_next_action_redirect_url" }} {% endif %} {% if payment_intent_redirect_action_handling %} diff --git a/src/pretix/static/pretixcontrol/js/ui/main.js b/src/pretix/static/pretixcontrol/js/ui/main.js index a108a32d2..9e27503f6 100644 --- a/src/pretix/static/pretixcontrol/js/ui/main.js +++ b/src/pretix/static/pretixcontrol/js/ui/main.js @@ -874,14 +874,6 @@ function setup_basics(el) { }); }); - el.find(".qrcode-canvas").each(function () { - $(this).qrcode( - { - text: $.trim($($(this).attr("data-qrdata")).html()) - } - ); - }); - el.find(".propagated-settings-box").find("input, textarea, select").not("[readonly]") .attr("data-propagated-locked", "true").prop("readonly", true);