From 9e434598794caf9435f69a1d55556619f3fcceea Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Wed, 30 Jan 2019 12:12:25 +0100 Subject: [PATCH] Widget: Guard against missing xhr.responseURL in Internet Explorer --- src/pretix/static/pretixpresale/js/widget/widget.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pretix/static/pretixpresale/js/widget/widget.js b/src/pretix/static/pretixpresale/js/widget/widget.js index 1b553e349c..203e3727dd 100644 --- a/src/pretix/static/pretixpresale/js/widget/widget.js +++ b/src/pretix/static/pretixpresale/js/widget/widget.js @@ -409,7 +409,7 @@ var shared_methods = { } }, buy_error_callback: function (xhr, data) { - if (xhr.status === 405) { + if (xhr.status === 405 && typeof xhr.responseURL !== "undefined") { // Likely a redirect! this.$root.event_url = xhr.responseURL.substr(0, xhr.responseURL.indexOf("/cart/add") - 18); this.$root.overlay.frame_loading = false; @@ -687,7 +687,7 @@ var shared_root_methods = { } var root = this.$root; api._getJSON(url, function (data, xhr) { - if (xhr.responseURL !== url) { + if (typeof xhr.responseURL !== "undefined" && xhr.responseURL !== url) { var new_url = xhr.responseURL.substr(0, xhr.responseURL.indexOf("/widget/product_list?") + 1); if (root.subevent) { new_url = new_url.substr(0, new_url.lastIndexOf("/", new_url.length - 1) + 1);