From d9322c1307f2abaabb5ac899f72bdca42cd9e896 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 13 May 2021 10:08:16 -0400 Subject: [PATCH] use swal titletext to avoid XSS (#966) --- src/app/tools/import.component.ts | 2 +- src/services/webPlatformUtils.service.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/tools/import.component.ts b/src/app/tools/import.component.ts index 6a0210760c..bac771d023 100644 --- a/src/app/tools/import.component.ts +++ b/src/app/tools/import.component.ts @@ -132,7 +132,7 @@ export class ImportComponent implements OnInit { inputAttributes: { 'readonly': 'true', }, - title: this.i18nService.t('importError'), + titleText: this.i18nService.t('importError'), text: this.i18nService.t('importErrorDesc'), showConfirmButton: true, confirmButtonText: this.i18nService.t('ok'), diff --git a/src/services/webPlatformUtils.service.ts b/src/services/webPlatformUtils.service.ts index dc942261ac..c87eeb2f10 100644 --- a/src/services/webPlatformUtils.service.ts +++ b/src/services/webPlatformUtils.service.ts @@ -203,7 +203,7 @@ export class WebPlatformUtilsService implements PlatformUtilsService { iconHtml: iconHtmlStr, text: bodyIsHtml ? null : body, html: bodyIsHtml ? body : null, - title: title, + titleText: title, showCancelButton: (cancelText != null), cancelButtonText: cancelText, showConfirmButton: true, @@ -217,7 +217,7 @@ export class WebPlatformUtilsService implements PlatformUtilsService { Promise { const result = await Swal.fire({ heightAuto: false, - title: title, + titleText: title, input: 'password', text: body, confirmButtonText: this.i18nService.t('ok'),