PluginProbe
King Addons for Elementor – 100+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce Builder, Mega Menu, Popup Builder / 51.1.83
King Addons for Elementor – 100+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce Builder, Mega Menu, Popup Builder v51.1.83
51.1.84 51.1.85 51.1.83 51.1.82 51.1.81 51.1.79 51.1.78 51.1.77 51.1.76 51.1.74 51.1.75 51.1.65 51.1.64 51.1.63 trunk 51.1.14 51.1.2 51.1.35 51.1.36 51.1.37 51.1.38 51.1.39 51.1.44 51.1.45 51.1.46 All 39 releases
← All changes | includes/widgets/Countdown/script.js +22 -4 51.1.3551.1.83 View file →
@@ -96,8 +96,21 @@
96 96 const dataActions = countDownWrap.data("actions");
97 97 // Skip if in elementor editor
98 98 if ($("body").hasClass("elementor-editor-active")) return;
99 99
100 + const normalizeSafeUrl = (rawUrl) => {
101 + if (!rawUrl || typeof rawUrl !== "string") return null;
102 + try {
103 + const url = new URL(rawUrl, window.location.href);
104 + if (url.protocol === "http:" || url.protocol === "https:") {
105 + return url.href;
106 + }
107 + } catch (e) {
108 + // ignore
109 + }
110 + return null;
111 + };
112 +
100 113 // Hide the timer
101 114 if (dataActions.hasOwnProperty("hide-timer")) {
102 115 countDownWrap.hide();
103 116 }
@@ -114,17 +127,22 @@
114 127 !$element
115 128 .children(".elementor-widget-container")
116 129 .children(messageSelector).length
117 130 ) {
118 - countDownWrap.after(
119 - `<div class="king-addons-countdown-message">${dataActions["message"]}</div>`
120 - );
131 + const $msg = $("<div />", {
132 + class: "king-addons-countdown-message",
133 + text: String(dataActions["message"] ?? ""),
134 + });
135 + countDownWrap.after($msg);
121 136 }
122 137 }
123 138
124 139 // Redirect
125 140 if (dataActions.hasOwnProperty("redirect")) {
126 - window.location.href = dataActions["redirect"];
141 + const destinationUrl = normalizeSafeUrl(dataActions["redirect"]);
142 + if (destinationUrl) {
143 + window.location.href = destinationUrl;
144 + }
127 145 }
128 146
129 147 // Load a template (show the next .elementor section)
130 148 if (dataActions.hasOwnProperty("load-template")) {