From 4b5733266d7d6aeb4f221a15e005db83fc198edf Mon Sep 17 00:00:00 2001 From: Christian F Date: Mon, 27 Feb 2023 13:14:42 +0100 Subject: [PATCH] [Task] Improve GDPR email search (#14410) * improved email in toolbar * added validator to email search input --- .../js/pimcore/settings/gdpr/dataproviders/sentMail.js | 2 +- .../public/js/pimcore/settings/gdpr/gdprPanel.js | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/bundles/AdminBundle/Resources/public/js/pimcore/settings/gdpr/dataproviders/sentMail.js b/bundles/AdminBundle/Resources/public/js/pimcore/settings/gdpr/dataproviders/sentMail.js index ea4539499f8..62afb48f02e 100644 --- a/bundles/AdminBundle/Resources/public/js/pimcore/settings/gdpr/dataproviders/sentMail.js +++ b/bundles/AdminBundle/Resources/public/js/pimcore/settings/gdpr/dataproviders/sentMail.js @@ -366,7 +366,7 @@ pimcore.settings.gdpr.dataproviders.sentMail = Class.create({ cls: 'pimcore_main_toolbar', items: [ { - text: t("gdpr_dataSource_sentMail_only_email") + ": " + this.searchParams.email, + text: t("gdpr_dataSource_sentMail_only_email") + ": " + Ext.util.Format.htmlEncode(this.searchParams.email), xtype: "tbtext", style: "margin: 0 10px 0 0;" } diff --git a/bundles/AdminBundle/Resources/public/js/pimcore/settings/gdpr/gdprPanel.js b/bundles/AdminBundle/Resources/public/js/pimcore/settings/gdpr/gdprPanel.js index 58f1814415a..fbfecaa1c04 100644 --- a/bundles/AdminBundle/Resources/public/js/pimcore/settings/gdpr/gdprPanel.js +++ b/bundles/AdminBundle/Resources/public/js/pimcore/settings/gdpr/gdprPanel.js @@ -76,7 +76,14 @@ pimcore.settings.gdpr.gdprPanel = Class.create({ xtype: 'textfield', name: 'email', fieldLabel: t("gdpr_data_extractor_label_email"), - width: 650 + width: 650, + validator: function (value) { + if(value !== value.replace(/[^a-zA-Z0-9_\-@.]/g,'')){ + this.setValue(value.replace(/[^a-zA-Z0-9_\-@.]/g,'')); + } + + return true; + } }, { xtype: "button",