diff --git a/src/module/alertModal.js b/src/module/alertModal.js index a4a82bf..1fed4bb 100644 --- a/src/module/alertModal.js +++ b/src/module/alertModal.js @@ -4,6 +4,7 @@ import ConformanceStore from '@/stores/conformance.js'; import FilesStore from '@/stores/files.js'; import PageAdminStore from '@/stores/pageAdmin.js'; import { useModalStore } from '@/stores/modal.js'; +import { escapeHtml } from '@/utils/escapeHtml.js'; const customClass = { container: '!z-[99999]', @@ -73,7 +74,7 @@ export async function savedSuccessfully(value) { value = value || ''; await Swal.fire({ title: 'SAVE COMPLETE', - html: `${value} has been saved in Lucia.`, + html: `${escapeHtml(value)} has been saved in Lucia.`, timer: 3000, // 停留 3 秒後自動關閉 showConfirmButton: false, icon: 'success', @@ -268,7 +269,7 @@ export async function uploadFailedFirst(failureType, failureMsg, failureLoc) { value = 'File is not in csv format.'; break; default: - value = failureMsg; + value = escapeHtml(failureMsg); break; } await Swal.fire({ @@ -297,10 +298,10 @@ export async function uploadFailedSecond(detail) { manySrt = 'There are more errors.'; break; case 'unrecognized': - content = `
Do you really want to delete ${name}?
The following dependent file(s) will also be deleted:
Do you really want to delete ${safeName}?
The following dependent file(s) will also be deleted: