From 2bfd8bbdb8f6f0b2e3ebc1bce46f0a500ddc99ef Mon Sep 17 00:00:00 2001 From: sebastien <dupuy@datakode.fr> Date: Tue, 12 Sep 2023 15:45:47 +0200 Subject: [PATCH] Ajout du controle html sur les formulaires --- .../Type/AnalyseCriterePrincipeFondamentalType.php | 1 + .../AIPD/Form/Type/AnalyseMesureProtectionType.php | 1 + .../Form/Type/AnalyseQuestionConformiteType.php | 1 + .../AIPD/Form/Type/AnalyseScenarioMenaceType.php | 1 + src/Domain/AIPD/Form/Type/AnalyseSingleAvisType.php | 1 + .../Form/Type/CriterePrincipeFondamentalType.php | 7 ++++++- .../AIPD/Form/Type/MesureProtectionAIPDType.php | 5 +++++ src/Domain/AIPD/Form/Type/ModeleAnalyseType.php | 5 +++++ .../AIPD/Form/Type/ModeleQuestionConformiteType.php | 3 +++ .../AIPD/Form/Type/ModeleScenarioMenaceType.php | 2 ++ src/Domain/Maturity/Form/Type/AnswerType.php | 2 ++ src/Domain/Maturity/Form/Type/DomainType.php | 2 ++ src/Domain/Maturity/Form/Type/QuestionType.php | 2 ++ src/Domain/Maturity/Form/Type/ReferentielType.php | 2 ++ .../Type/ConformiteOrganisation/ParticipantType.php | 3 +++ .../Type/ConformiteOrganisation/ReponseType.php | 1 + src/Domain/Registry/Form/Type/ContractorType.php | 3 +++ .../Registry/Form/Type/Embeddable/AddressType.php | 6 ++++++ .../Registry/Form/Type/Embeddable/DelayType.php | 1 + .../Form/Type/Embeddable/RequestAnswerType.php | 1 + .../Form/Type/Embeddable/RequestApplicantType.php | 4 ++++ .../Type/Embeddable/RequestConcernedPeopleType.php | 5 +++++ src/Domain/Registry/Form/Type/MesurementType.php | 6 ++++++ src/Domain/Registry/Form/Type/ProofType.php | 2 ++ src/Domain/Registry/Form/Type/RequestType.php | 3 +++ src/Domain/Registry/Form/Type/ShelfLifeType.php | 2 ++ src/Domain/Registry/Form/Type/ToolType.php | 7 +++++++ src/Domain/Registry/Form/Type/TreatmentType.php | 13 +++++++++++++ src/Domain/Registry/Form/Type/ViolationType.php | 4 ++++ src/Domain/User/Form/Type/AddressType.php | 5 +++++ src/Domain/User/Form/Type/CollectivityType.php | 4 ++++ src/Domain/User/Form/Type/ContactType.php | 5 +++++ src/Domain/User/Form/Type/ServiceType.php | 1 + src/Domain/User/Form/Type/UserType.php | 3 +++ 34 files changed, 113 insertions(+), 1 deletion(-) diff --git a/src/Domain/AIPD/Form/Type/AnalyseCriterePrincipeFondamentalType.php b/src/Domain/AIPD/Form/Type/AnalyseCriterePrincipeFondamentalType.php index 9baabdefa..25562de3b 100644 --- a/src/Domain/AIPD/Form/Type/AnalyseCriterePrincipeFondamentalType.php +++ b/src/Domain/AIPD/Form/Type/AnalyseCriterePrincipeFondamentalType.php @@ -32,6 +32,7 @@ class AnalyseCriterePrincipeFondamentalType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('fichierFile', FileType::class, [ 'required' => false, diff --git a/src/Domain/AIPD/Form/Type/AnalyseMesureProtectionType.php b/src/Domain/AIPD/Form/Type/AnalyseMesureProtectionType.php index 1d0e69a2e..87d720089 100644 --- a/src/Domain/AIPD/Form/Type/AnalyseMesureProtectionType.php +++ b/src/Domain/AIPD/Form/Type/AnalyseMesureProtectionType.php @@ -23,6 +23,7 @@ class AnalyseMesureProtectionType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ; } diff --git a/src/Domain/AIPD/Form/Type/AnalyseQuestionConformiteType.php b/src/Domain/AIPD/Form/Type/AnalyseQuestionConformiteType.php index 74c359e7c..224f9f99a 100644 --- a/src/Domain/AIPD/Form/Type/AnalyseQuestionConformiteType.php +++ b/src/Domain/AIPD/Form/Type/AnalyseQuestionConformiteType.php @@ -20,6 +20,7 @@ class AnalyseQuestionConformiteType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]); } diff --git a/src/Domain/AIPD/Form/Type/AnalyseScenarioMenaceType.php b/src/Domain/AIPD/Form/Type/AnalyseScenarioMenaceType.php index a87128b1c..4b583f3de 100644 --- a/src/Domain/AIPD/Form/Type/AnalyseScenarioMenaceType.php +++ b/src/Domain/AIPD/Form/Type/AnalyseScenarioMenaceType.php @@ -59,6 +59,7 @@ class AnalyseScenarioMenaceType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ; } diff --git a/src/Domain/AIPD/Form/Type/AnalyseSingleAvisType.php b/src/Domain/AIPD/Form/Type/AnalyseSingleAvisType.php index b08caff01..383a57fbd 100644 --- a/src/Domain/AIPD/Form/Type/AnalyseSingleAvisType.php +++ b/src/Domain/AIPD/Form/Type/AnalyseSingleAvisType.php @@ -36,6 +36,7 @@ class AnalyseSingleAvisType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ; } diff --git a/src/Domain/AIPD/Form/Type/CriterePrincipeFondamentalType.php b/src/Domain/AIPD/Form/Type/CriterePrincipeFondamentalType.php index f82a206a0..de74cc18e 100644 --- a/src/Domain/AIPD/Form/Type/CriterePrincipeFondamentalType.php +++ b/src/Domain/AIPD/Form/Type/CriterePrincipeFondamentalType.php @@ -27,11 +27,12 @@ class CriterePrincipeFondamentalType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('label', TextType::class) + ->add('label', TextType::class,['purify_html' => true,]) ->add('labelLivrable', TextType::class, [ 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('reponse', DictionaryType::class, [ 'name' => 'reponse_critere_fondamental', @@ -44,22 +45,26 @@ class CriterePrincipeFondamentalType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('texteNonConformite', TextType::class, [ 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('texteNonApplicable', TextType::class, [ 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('justification', TextType::class, [ 'required' => false, 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('deleteFile', HiddenType::class, [ 'data' => 0, diff --git a/src/Domain/AIPD/Form/Type/MesureProtectionAIPDType.php b/src/Domain/AIPD/Form/Type/MesureProtectionAIPDType.php index 2a02c655a..ac8b4fdc0 100644 --- a/src/Domain/AIPD/Form/Type/MesureProtectionAIPDType.php +++ b/src/Domain/AIPD/Form/Type/MesureProtectionAIPDType.php @@ -20,26 +20,31 @@ class MesureProtectionAIPDType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('nomCourt', TextType::class, [ 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('labelLivrable', TextType::class, [ 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('phrasePreconisation', TextType::class, [ 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('detail', TextType::class, [ 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('poidsVraisemblance', IntegerType::class, [ 'attr' => [ diff --git a/src/Domain/AIPD/Form/Type/ModeleAnalyseType.php b/src/Domain/AIPD/Form/Type/ModeleAnalyseType.php index 47b2f51c5..8d87242bf 100644 --- a/src/Domain/AIPD/Form/Type/ModeleAnalyseType.php +++ b/src/Domain/AIPD/Form/Type/ModeleAnalyseType.php @@ -24,30 +24,35 @@ class ModeleAnalyseType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('description', TextType::class, [ 'required' => true, 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('labelAmeliorationPrevue', TextType::class, [ 'required' => true, 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('labelInsatisfaisant', TextType::class, [ 'required' => true, 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('labelSatisfaisant', TextType::class, [ 'required' => true, 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('criterePrincipeFondamentaux', CollectionType::class, [ 'entry_type' => CriterePrincipeFondamentalType::class, diff --git a/src/Domain/AIPD/Form/Type/ModeleQuestionConformiteType.php b/src/Domain/AIPD/Form/Type/ModeleQuestionConformiteType.php index 57d6964a3..9d32ca135 100644 --- a/src/Domain/AIPD/Form/Type/ModeleQuestionConformiteType.php +++ b/src/Domain/AIPD/Form/Type/ModeleQuestionConformiteType.php @@ -25,18 +25,21 @@ class ModeleQuestionConformiteType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('texteNonConformiteMineure', TextType::class, [ 'required' => false, 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('texteNonConformiteMajeure', TextType::class, [ 'required' => false, 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ; } diff --git a/src/Domain/AIPD/Form/Type/ModeleScenarioMenaceType.php b/src/Domain/AIPD/Form/Type/ModeleScenarioMenaceType.php index acb60e443..4ed9e67f4 100644 --- a/src/Domain/AIPD/Form/Type/ModeleScenarioMenaceType.php +++ b/src/Domain/AIPD/Form/Type/ModeleScenarioMenaceType.php @@ -24,6 +24,7 @@ class ModeleScenarioMenaceType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('mesuresProtections', EntityType::class, [ 'required' => false, @@ -69,6 +70,7 @@ class ModeleScenarioMenaceType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ; } diff --git a/src/Domain/Maturity/Form/Type/AnswerType.php b/src/Domain/Maturity/Form/Type/AnswerType.php index 7fa63b95d..d0723869d 100644 --- a/src/Domain/Maturity/Form/Type/AnswerType.php +++ b/src/Domain/Maturity/Form/Type/AnswerType.php @@ -46,6 +46,7 @@ class AnswerType extends AbstractType 'maxlength' => 1000, 'required' => 'required', ], + 'purify_html' => true, ]) ->add('recommendation', TextType::class, [ 'label' => 'maturity.referentiel.form.recommendation', @@ -53,6 +54,7 @@ class AnswerType extends AbstractType 'attr' => [ 'maxlength' => 1000, ], + 'purify_html' => true, ]) ->add('position', HiddenType::class, [ 'required' => true, diff --git a/src/Domain/Maturity/Form/Type/DomainType.php b/src/Domain/Maturity/Form/Type/DomainType.php index 795fd19a8..07fc6df9d 100644 --- a/src/Domain/Maturity/Form/Type/DomainType.php +++ b/src/Domain/Maturity/Form/Type/DomainType.php @@ -50,6 +50,7 @@ class DomainType extends AbstractType 'attr' => [ 'maxlength' => 1000, ], + 'purify_html' => true, ]) ->add('description', TextareaType::class, [ @@ -58,6 +59,7 @@ class DomainType extends AbstractType 'attr' => [ 'rows' => 3, ], + 'purify_html' => true, ]) ->add('questions', CollectionType::class, [ diff --git a/src/Domain/Maturity/Form/Type/QuestionType.php b/src/Domain/Maturity/Form/Type/QuestionType.php index 33828d0db..e0b4af711 100644 --- a/src/Domain/Maturity/Form/Type/QuestionType.php +++ b/src/Domain/Maturity/Form/Type/QuestionType.php @@ -52,6 +52,7 @@ class QuestionType extends AbstractType 'attr' => [ 'maxlength' => 1000, ], + 'purify_html' => true, ]) ->add('weight', ChoiceType::class, [ 'label' => 'maturity.referentiel.form.weight', @@ -77,6 +78,7 @@ class QuestionType extends AbstractType 'placeholder' => 'Précisez', 'maxlength' => 1000, ], + 'purify_html' => true, ]) ->add('answers', CollectionType::class, [ 'label' => 'maturity.referentiel.form.answer', diff --git a/src/Domain/Maturity/Form/Type/ReferentielType.php b/src/Domain/Maturity/Form/Type/ReferentielType.php index d97e01682..91a8d480a 100644 --- a/src/Domain/Maturity/Form/Type/ReferentielType.php +++ b/src/Domain/Maturity/Form/Type/ReferentielType.php @@ -46,6 +46,7 @@ class ReferentielType extends AbstractType 'attr' => [ 'maxlength' => 1000, ], + 'purify_html' => true, ]) ->add('description', TextareaType::class, [ 'label' => 'maturity.referentiel.form.description', @@ -53,6 +54,7 @@ class ReferentielType extends AbstractType 'attr' => [ 'rows' => 3, ], + 'purify_html' => true, ]) ->add('domains', CollectionType::class, [ 'entry_type' => DomainType::class, diff --git a/src/Domain/Registry/Form/Type/ConformiteOrganisation/ParticipantType.php b/src/Domain/Registry/Form/Type/ConformiteOrganisation/ParticipantType.php index a1cfb4d1b..e26c20824 100644 --- a/src/Domain/Registry/Form/Type/ConformiteOrganisation/ParticipantType.php +++ b/src/Domain/Registry/Form/Type/ConformiteOrganisation/ParticipantType.php @@ -20,6 +20,7 @@ class ParticipantType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('nomDeFamille', TextType::class, [ 'label' => 'registry.conformite_organisation.participant.form.nom_famille', @@ -27,6 +28,7 @@ class ParticipantType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('civilite', DictionaryType::class, [ 'label' => 'user.contact.form.civility', @@ -39,6 +41,7 @@ class ParticipantType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ; } diff --git a/src/Domain/Registry/Form/Type/ConformiteOrganisation/ReponseType.php b/src/Domain/Registry/Form/Type/ConformiteOrganisation/ReponseType.php index b4373617d..eafc57c9e 100644 --- a/src/Domain/Registry/Form/Type/ConformiteOrganisation/ReponseType.php +++ b/src/Domain/Registry/Form/Type/ConformiteOrganisation/ReponseType.php @@ -34,6 +34,7 @@ class ReponseType extends AbstractType 'placeholder' => 'placeholder.precision', 'maxlength' => 255, ], + 'purify_html' => true, ]) ; } diff --git a/src/Domain/Registry/Form/Type/ContractorType.php b/src/Domain/Registry/Form/Type/ContractorType.php index cffb755d9..da82e1d0b 100644 --- a/src/Domain/Registry/Form/Type/ContractorType.php +++ b/src/Domain/Registry/Form/Type/ContractorType.php @@ -72,6 +72,7 @@ class ContractorType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ; if ($contractor->getCollectivity()->getIsServicesEnabled()) { @@ -112,6 +113,7 @@ class ContractorType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('contractualClausesVerified', CheckboxType::class, [ 'label' => 'registry.contractor.form.contractual_clauses_verified', @@ -135,6 +137,7 @@ class ContractorType extends AbstractType 'attr' => [ 'rows' => 4, ], + 'purify_html' => true, ]) ->add('address', AddressType::class, [ 'label' => 'registry.contractor.form.address', diff --git a/src/Domain/Registry/Form/Type/Embeddable/AddressType.php b/src/Domain/Registry/Form/Type/Embeddable/AddressType.php index a3676e753..69fc21e0f 100644 --- a/src/Domain/Registry/Form/Type/Embeddable/AddressType.php +++ b/src/Domain/Registry/Form/Type/Embeddable/AddressType.php @@ -47,6 +47,7 @@ class AddressType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('lineTwo', TextType::class, [ 'label' => 'registry.address.form.line_two', @@ -54,6 +55,7 @@ class AddressType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('city', TextType::class, [ 'label' => 'registry.address.form.city', @@ -61,6 +63,7 @@ class AddressType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('zipCode', TextType::class, [ 'label' => 'registry.address.form.zip_code', @@ -68,6 +71,7 @@ class AddressType extends AbstractType 'attr' => [ 'maxlength' => 5, ], + 'purify_html' => true, ]) ->add('mail', EmailType::class, [ 'label' => 'registry.address.form.mail', @@ -79,6 +83,7 @@ class AddressType extends AbstractType ->add('phoneNumber', TextType::class, [ 'label' => 'registry.address.form.phone_number', 'required' => $required, + 'purify_html' => true, ]) ->add('country', TextType::class, [ 'label' => 'registry.address.form.country', @@ -86,6 +91,7 @@ class AddressType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]); } diff --git a/src/Domain/Registry/Form/Type/Embeddable/DelayType.php b/src/Domain/Registry/Form/Type/Embeddable/DelayType.php index 46e8ad9a6..01aa0fe89 100644 --- a/src/Domain/Registry/Form/Type/Embeddable/DelayType.php +++ b/src/Domain/Registry/Form/Type/Embeddable/DelayType.php @@ -60,6 +60,7 @@ class DelayType extends AbstractType ->add('comment', TextareaType::class, [ 'label' => false, 'required' => false, + 'purify_html' => true, ]) ; } diff --git a/src/Domain/Registry/Form/Type/Embeddable/RequestAnswerType.php b/src/Domain/Registry/Form/Type/Embeddable/RequestAnswerType.php index 9f0e90bc6..b1577d3a9 100644 --- a/src/Domain/Registry/Form/Type/Embeddable/RequestAnswerType.php +++ b/src/Domain/Registry/Form/Type/Embeddable/RequestAnswerType.php @@ -46,6 +46,7 @@ class RequestAnswerType extends AbstractType 'attr' => [ 'rows' => 4, ], + 'purify_html' => true, ]) ->add('date', DateType::class, [ 'label' => 'registry.request_answer.form.date', diff --git a/src/Domain/Registry/Form/Type/Embeddable/RequestApplicantType.php b/src/Domain/Registry/Form/Type/Embeddable/RequestApplicantType.php index 6aefda9d1..4b40835bc 100644 --- a/src/Domain/Registry/Form/Type/Embeddable/RequestApplicantType.php +++ b/src/Domain/Registry/Form/Type/Embeddable/RequestApplicantType.php @@ -52,6 +52,7 @@ class RequestApplicantType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('lastName', TextType::class, [ 'label' => 'registry.request_applicant.form.last_name', @@ -59,6 +60,7 @@ class RequestApplicantType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('address', TextType::class, [ 'label' => 'registry.request_applicant.form.address', @@ -66,6 +68,7 @@ class RequestApplicantType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('mail', EmailType::class, [ 'label' => 'registry.request_applicant.form.mail', @@ -74,6 +77,7 @@ class RequestApplicantType extends AbstractType ->add('phoneNumber', TextType::class, [ 'label' => 'registry.request_applicant.form.phone_number', 'required' => false, + 'purify_html' => true, ]) ->add('concernedPeople', CheckboxType::class, [ 'label' => 'registry.request_applicant.form.concerned_people', diff --git a/src/Domain/Registry/Form/Type/Embeddable/RequestConcernedPeopleType.php b/src/Domain/Registry/Form/Type/Embeddable/RequestConcernedPeopleType.php index 18e64651c..5005302af 100644 --- a/src/Domain/Registry/Form/Type/Embeddable/RequestConcernedPeopleType.php +++ b/src/Domain/Registry/Form/Type/Embeddable/RequestConcernedPeopleType.php @@ -51,6 +51,7 @@ class RequestConcernedPeopleType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('lastName', TextType::class, [ 'label' => 'registry.request_concerned_people.form.last_name', @@ -58,6 +59,7 @@ class RequestConcernedPeopleType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('address', TextType::class, [ 'label' => 'registry.request_concerned_people.form.address', @@ -65,6 +67,7 @@ class RequestConcernedPeopleType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('mail', EmailType::class, [ 'label' => 'registry.request_concerned_people.form.mail', @@ -73,6 +76,7 @@ class RequestConcernedPeopleType extends AbstractType ->add('phoneNumber', TextType::class, [ 'label' => 'registry.request_concerned_people.form.phone_number', 'required' => false, + 'purify_html' => true, ]) ->add('linkWithApplicant', TextType::class, [ 'label' => 'registry.request_concerned_people.form.link_with_applicant', @@ -80,6 +84,7 @@ class RequestConcernedPeopleType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ; } diff --git a/src/Domain/Registry/Form/Type/MesurementType.php b/src/Domain/Registry/Form/Type/MesurementType.php index 49b3802f5..0f2541abf 100644 --- a/src/Domain/Registry/Form/Type/MesurementType.php +++ b/src/Domain/Registry/Form/Type/MesurementType.php @@ -79,6 +79,7 @@ class MesurementType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) /* ->add('type', DictionaryType::class, [ @@ -95,6 +96,7 @@ class MesurementType extends AbstractType 'attr' => [ 'rows' => 3, ], + 'purify_html' => true, ]) ->add('cost', TextType::class, [ 'label' => 'registry.mesurement.form.cost', @@ -102,6 +104,7 @@ class MesurementType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('charge', TextType::class, [ 'label' => 'registry.mesurement.form.charge', @@ -109,6 +112,7 @@ class MesurementType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('status', DictionaryType::class, [ 'label' => 'registry.mesurement.form.status', @@ -133,6 +137,7 @@ class MesurementType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('priority', DictionaryType::class, [ 'label' => 'registry.mesurement.form.priority', @@ -146,6 +151,7 @@ class MesurementType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('contractors', EntityType::class, [ 'label' => 'registry.mesurement.form.contractor', diff --git a/src/Domain/Registry/Form/Type/ProofType.php b/src/Domain/Registry/Form/Type/ProofType.php index 0b1123d4f..f413041d7 100644 --- a/src/Domain/Registry/Form/Type/ProofType.php +++ b/src/Domain/Registry/Form/Type/ProofType.php @@ -80,6 +80,7 @@ class ProofType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('type', DictionaryType::class, [ 'label' => 'registry.proof.form.type', @@ -128,6 +129,7 @@ class ProofType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('treatments', EntityType::class, [ 'label' => 'registry.proof.form.treatments', diff --git a/src/Domain/Registry/Form/Type/RequestType.php b/src/Domain/Registry/Form/Type/RequestType.php index 859626689..f94a9c1d9 100644 --- a/src/Domain/Registry/Form/Type/RequestType.php +++ b/src/Domain/Registry/Form/Type/RequestType.php @@ -115,6 +115,7 @@ class RequestType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('date', DateType::class, [ 'label' => 'registry.request.form.date', @@ -132,6 +133,7 @@ class RequestType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('applicant', RequestApplicantType::class, [ 'label' => false, @@ -168,6 +170,7 @@ class RequestType extends AbstractType 'attr' => [ 'rows' => 4, ], + 'purify_html' => true, ]) ->add('treatments', EntityType::class, [ 'class' => Treatment::class, diff --git a/src/Domain/Registry/Form/Type/ShelfLifeType.php b/src/Domain/Registry/Form/Type/ShelfLifeType.php index d7a3945ea..7875ee75c 100644 --- a/src/Domain/Registry/Form/Type/ShelfLifeType.php +++ b/src/Domain/Registry/Form/Type/ShelfLifeType.php @@ -20,6 +20,7 @@ class ShelfLifeType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('duration', TextType::class, [ 'label' => 'registry.treatment.form.shelflife_duration', @@ -27,6 +28,7 @@ class ShelfLifeType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('ultimate_fate', DictionaryType::class, [ 'label' => 'registry.treatment.form.shelflife_ultimate_fate', diff --git a/src/Domain/Registry/Form/Type/ToolType.php b/src/Domain/Registry/Form/Type/ToolType.php index 4ecbb3a82..a1e87d7c0 100644 --- a/src/Domain/Registry/Form/Type/ToolType.php +++ b/src/Domain/Registry/Form/Type/ToolType.php @@ -72,6 +72,7 @@ class ToolType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, 'constraints' => [ new NotBlank(), new Length(['min' => 3]), @@ -91,6 +92,7 @@ class ToolType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('other_info', TextareaType::class, [ 'label' => 'registry.tool.form.other_info', @@ -98,6 +100,7 @@ class ToolType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('editor', TextType::class, [ 'label' => 'registry.tool.form.editor', @@ -105,6 +108,7 @@ class ToolType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('manager', TextType::class, [ 'label' => 'registry.tool.form.manager', @@ -112,6 +116,7 @@ class ToolType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('contractors', EntityType::class, [ @@ -172,11 +177,13 @@ class ToolType extends AbstractType ->add('country_name', TextType::class, [ 'label' => 'registry.tool.form.country_name', 'required' => false, + 'purify_html' => true, ]) ->add('country_guarantees', TextType::class, [ 'label' => 'registry.tool.form.country_guarantees', 'required' => true, + 'purify_html' => true, ]) ->add('archival', ComplexChoiceType::class, [ diff --git a/src/Domain/Registry/Form/Type/TreatmentType.php b/src/Domain/Registry/Form/Type/TreatmentType.php index 8491cbebd..25a43edda 100644 --- a/src/Domain/Registry/Form/Type/TreatmentType.php +++ b/src/Domain/Registry/Form/Type/TreatmentType.php @@ -82,6 +82,7 @@ class TreatmentType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('exempt_AIPD', CheckboxType::class, [ 'label' => 'registry.treatment.form.exemptAipd', @@ -94,6 +95,7 @@ class TreatmentType extends AbstractType 'attr' => [ 'rows' => 4, ], + 'purify_html' => true, ]) ->add('manager', TextType::class, [ 'label' => 'registry.treatment.form.manager', @@ -101,6 +103,7 @@ class TreatmentType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('paperProcessing', CheckboxType::class, [ @@ -117,6 +120,7 @@ class TreatmentType extends AbstractType ->add('legalBasisJustification', TextareaType::class, [ 'label' => 'registry.treatment.form.legal_basis_justification', 'required' => false, + 'purify_html' => true, ]) ->add('observation', TextareaType::class, [ 'label' => 'registry.treatment.form.observation', @@ -124,6 +128,7 @@ class TreatmentType extends AbstractType 'attr' => [ 'rows' => 2, ], + 'purify_html' => true, ]) ->add('concernedPeopleParticular', ComplexChoiceType::class, [ 'label' => 'registry.treatment.form.concerned_people_particular', @@ -189,6 +194,7 @@ class TreatmentType extends AbstractType 'attr' => [ 'rows' => 3, ], + 'purify_html' => true, ]) ->add('dataOrigin', TextType::class, [ 'label' => 'registry.treatment.form.data_origin', @@ -196,6 +202,7 @@ class TreatmentType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('recipientCategory', TextareaType::class, [ 'label' => 'registry.treatment.form.recipient_category', @@ -203,6 +210,7 @@ class TreatmentType extends AbstractType 'attr' => [ 'rows' => 2, ], + 'purify_html' => true, ]) ->add('contractors', EntityType::class, [ 'label' => 'registry.treatment.form.contractors', @@ -306,6 +314,7 @@ class TreatmentType extends AbstractType 'attr' => [ 'rows' => 3, ], + 'purify_html' => true, ]) ->add('collectingMethod', DictionaryType::class, [ 'label' => 'registry.treatment.form.collecting_method', @@ -352,6 +361,7 @@ class TreatmentType extends AbstractType ->add('otherCollectingMethod', TextType::class, [ 'label' => 'registry.treatment.form.otherCollectingMethod', 'required' => false, + 'purify_html' => true, ]) ->add('updatedBy', HiddenType::class, [ 'required' => false, @@ -368,6 +378,7 @@ class TreatmentType extends AbstractType ->add('consentRequestFormat', TextType::class, [ 'label' => 'registry.treatment.form.consentRequestFormat', 'required' => false, + 'purify_html' => true, ]) ; @@ -377,6 +388,7 @@ class TreatmentType extends AbstractType ->add('dpoMessage', TextAreaType::class, [ 'label' => 'registry.treatment.form.dpoMessage', 'required' => false, + 'purify_html' => true, ]) ->add('statut', DictionaryType::class, [ 'label' => 'registry.treatment.form.statut', @@ -427,6 +439,7 @@ class TreatmentType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]); } diff --git a/src/Domain/Registry/Form/Type/ViolationType.php b/src/Domain/Registry/Form/Type/ViolationType.php index 59b6d63da..a9279abf6 100644 --- a/src/Domain/Registry/Form/Type/ViolationType.php +++ b/src/Domain/Registry/Form/Type/ViolationType.php @@ -211,12 +211,14 @@ class ViolationType extends AbstractType 'attr' => [ 'rows' => 5, ], + 'purify_html' => true, ]) ->add('appliedMeasuresAfterViolation', TextareaType::class, [ 'label' => 'registry.violation.form.applied_measures_after_violation', 'attr' => [ 'rows' => 5, ], + 'purify_html' => true, ]) ->add('notification', DictionaryType::class, [ 'label' => 'registry.violation.form.notification', @@ -231,6 +233,7 @@ class ViolationType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('comment', TextareaType::class, [ 'label' => 'registry.violation.form.comment', @@ -238,6 +241,7 @@ class ViolationType extends AbstractType 'attr' => [ 'rows' => 5, ], + 'purify_html' => true, ]) ->add('treatments', EntityType::class, [ 'class' => Treatment::class, diff --git a/src/Domain/User/Form/Type/AddressType.php b/src/Domain/User/Form/Type/AddressType.php index 905f26d10..3c0862aab 100644 --- a/src/Domain/User/Form/Type/AddressType.php +++ b/src/Domain/User/Form/Type/AddressType.php @@ -44,6 +44,7 @@ class AddressType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('lineTwo', TextType::class, [ 'label' => 'user.address.form.line_two', @@ -51,6 +52,7 @@ class AddressType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('city', TextType::class, [ 'label' => 'user.address.form.city', @@ -58,6 +60,7 @@ class AddressType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('zipCode', TextType::class, [ 'label' => 'user.address.form.zip_code', @@ -65,6 +68,7 @@ class AddressType extends AbstractType 'attr' => [ 'maxlength' => 5, ], + 'purify_html' => true, ]) ->add('insee', TextType::class, [ 'label' => 'user.address.form.insee', @@ -72,6 +76,7 @@ class AddressType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ; } diff --git a/src/Domain/User/Form/Type/CollectivityType.php b/src/Domain/User/Form/Type/CollectivityType.php index d18aaa5bc..fbb989b67 100644 --- a/src/Domain/User/Form/Type/CollectivityType.php +++ b/src/Domain/User/Form/Type/CollectivityType.php @@ -79,6 +79,7 @@ class CollectivityType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('shortName', TextType::class, [ 'label' => 'user.collectivity.form.short_name', @@ -86,6 +87,7 @@ class CollectivityType extends AbstractType 'attr' => [ 'maxlength' => 20, ], + 'purify_html' => true, ]) ->add('type', DictionaryType::class, [ 'label' => 'user.collectivity.form.type', @@ -130,6 +132,7 @@ class CollectivityType extends AbstractType ->add('informationsComplementaires', TextareaType::class, [ 'label' => 'user.collectivity.form.informations_complementaires', 'required' => false, + 'purify_html' => true, ]) ->add('finessGeo', TextType::class, [ 'label' => 'user.collectivity.form.finess_geo', @@ -137,6 +140,7 @@ class CollectivityType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('nbrCnil', NumberType::class, [ 'label' => 'user.collectivity.form.nbr_cnil', diff --git a/src/Domain/User/Form/Type/ContactType.php b/src/Domain/User/Form/Type/ContactType.php index ce1790b14..987482185 100644 --- a/src/Domain/User/Form/Type/ContactType.php +++ b/src/Domain/User/Form/Type/ContactType.php @@ -77,6 +77,7 @@ class ContactType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('lastName', TextType::class, [ 'label' => 'user.contact.form.last_name', @@ -84,6 +85,7 @@ class ContactType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('job', TextType::class, [ 'label' => 'user.contact.form.job', @@ -91,6 +93,7 @@ class ContactType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ->add('mail', EmailType::class, [ 'label' => 'user.contact.form.mail', @@ -98,6 +101,7 @@ class ContactType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true, ]) ; @@ -121,6 +125,7 @@ class ContactType extends AbstractType 'attr' => [ 'maxlength' => 10, ], + 'purify_html' => true, ]); } diff --git a/src/Domain/User/Form/Type/ServiceType.php b/src/Domain/User/Form/Type/ServiceType.php index 085812993..1ec5e05fc 100644 --- a/src/Domain/User/Form/Type/ServiceType.php +++ b/src/Domain/User/Form/Type/ServiceType.php @@ -39,6 +39,7 @@ class ServiceType extends AbstractType $builder->add('name', TextType::class, [ 'label' => 'Nom', 'validation_groups' => ['default'], + 'purify_html' => true, ]); } diff --git a/src/Domain/User/Form/Type/UserType.php b/src/Domain/User/Form/Type/UserType.php index 3eeb94ea9..7e18e35ab 100644 --- a/src/Domain/User/Form/Type/UserType.php +++ b/src/Domain/User/Form/Type/UserType.php @@ -150,6 +150,7 @@ class UserType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true ]); $builder @@ -214,6 +215,7 @@ class UserType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true ]) ->add('lastName', TextType::class, [ 'label' => 'user.user.form.last_name', @@ -221,6 +223,7 @@ class UserType extends AbstractType 'attr' => [ 'maxlength' => 255, ], + 'purify_html' => true ]) ->add('email', EmailType::class, [ 'label' => 'user.user.form.email', -- GitLab