From f09afccf1d8a0021890cc7df9834ac75db5f1d08 Mon Sep 17 00:00:00 2001 From: Edoardo Spadoni Date: Wed, 14 Feb 2024 14:25:59 +0100 Subject: [PATCH] sun-ui. download pricavy: fix escape (#189) --- .../src/components/details-view/HotspotsDetails.vue | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sun/sun-ui/src/components/details-view/HotspotsDetails.vue b/sun/sun-ui/src/components/details-view/HotspotsDetails.vue index 55b442030..70ee8124f 100644 --- a/sun/sun-ui/src/components/details-view/HotspotsDetails.vue +++ b/sun/sun-ui/src/components/details-view/HotspotsDetails.vue @@ -2887,17 +2887,15 @@ export default { ); }, printPrivacy() { - var finalPrivacy = "data:text/plain;charset=utf-8," + (this.selectedPrivacyBody || ""); - var encodedUri = encodeURI(finalPrivacy); + var finalPrivacy = "data:text/plain;charset=utf-8," + encodeURIComponent(this.selectedPrivacyBody || ""); var link = document.createElement("a"); - link.setAttribute("href", encodedUri); + link.setAttribute("href", finalPrivacy); link.setAttribute("download", "privacy" + ".txt"); link.click(); - var finalTos = "data:text/plain;charset=utf-8," + this.selectedTosBody; - var encodedUri = encodeURI(finalTos); + var finalTos = "data:text/plain;charset=utf-8," + encodeURIComponent(this.selectedTosBody || ""); var link = document.createElement("a"); - link.setAttribute("href", encodedUri); + link.setAttribute("href", finalTos); link.setAttribute("download", "tos" + ".txt"); link.click(); },