sanitize href

This commit is contained in:
Pete Matsyburka
2024-03-13 11:09:18 +02:00
parent 849289287e
commit 2ce57df485
2 changed files with 13 additions and 2 deletions
+7 -1
View File
@@ -16,7 +16,8 @@
<div class="space-y-3 mt-5">
<a
v-if="completedButton.url"
:href="completedButton.url"
:href="sanitizeHref(completedButton.url)"
rel="noopener noreferrer nofollow"
class="white-button flex items-center w-full"
>
<span>
@@ -215,6 +216,11 @@ export default {
this.isDownloading = false
},
sanitizeHref (href) {
if (href && href.trim().match(/^((?:https?:\/\/)|\/)/)) {
return href.replace(/javascript:/g, '')
}
},
downloadSafariIos (urls) {
const fileRequests = urls.map((url) => {
return fetch(url).then(async (resp) => {