diff --git a/composer.json b/composer.json index cfe82e622155e1d288708dfd2128de9d5819700d..f5a446af943fc575aa0ea573b78953c4b0f409e5 100755 --- a/composer.json +++ b/composer.json @@ -20,6 +20,7 @@ "doctrine/doctrine-bundle": "^2", "doctrine/doctrine-migrations-bundle": "^2", "doctrine/orm": "^2", + "exercise/htmlpurifier-bundle": "*", "firebase/php-jwt": "^6.4", "friendsofsymfony/ckeditor-bundle": "^2.2", "ircmaxell/random-lib": "^1.2", diff --git a/composer.lock b/composer.lock index 0cfdab2696a953aea28b6238ed9d7c972028f714..1aa35a85ec7f4f907ac25f9786ee7154c1621b53 100755 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "86286b50f033415519057050bd6bc3ea", + "content-hash": "5dc0ff747b288475eebf585081351e25", "packages": [ { "name": "api-platform/core", @@ -1933,6 +1933,129 @@ ], "time": "2023-01-14T14:17:03+00:00" }, + { + "name": "exercise/htmlpurifier-bundle", + "version": "4.1.2", + "source": { + "type": "git", + "url": "https://github.com/Exercise/HTMLPurifierBundle.git", + "reference": "526c98e5b6ca712874d6422b98f32233b81f4c19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Exercise/HTMLPurifierBundle/zipball/526c98e5b6ca712874d6422b98f32233b81f4c19", + "reference": "526c98e5b6ca712874d6422b98f32233b81f4c19", + "shasum": "" + }, + "require": { + "ezyang/htmlpurifier": "~4.14", + "php": "^7.1.3 || ^8.0.0", + "symfony/config": "~4.4 || ^5.0 || ^6.0", + "symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0", + "symfony/http-kernel": "^4.4 || ^5.0 || ^6.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.0", + "symfony/form": "^4.4 || ^5.0 || ^6.0", + "symfony/phpunit-bridge": "^6.0", + "twig/twig": "^1.35.0 || ^2.4.4 || ^3.0" + }, + "type": "symfony-bundle", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, + "autoload": { + "psr-4": { + "Exercise\\HTMLPurifierBundle\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "contributors", + "homepage": "https://github.com/Exercise/HTMLPurifierBundle/contributors" + } + ], + "description": "HTMLPurifier integration for your Symfony project", + "homepage": "https://github.com/Exercise/HTMLPurifierBundle", + "keywords": [ + "Purifier", + "html", + "htmlpurifier", + "symfony" + ], + "support": { + "issues": "https://github.com/Exercise/HTMLPurifierBundle/issues", + "source": "https://github.com/Exercise/HTMLPurifierBundle/tree/4.1.2" + }, + "time": "2023-07-05T07:14:30+00:00" + }, + { + "name": "ezyang/htmlpurifier", + "version": "v4.16.0", + "source": { + "type": "git", + "url": "https://github.com/ezyang/htmlpurifier.git", + "reference": "523407fb06eb9e5f3d59889b3978d5bfe94299c8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/523407fb06eb9e5f3d59889b3978d5bfe94299c8", + "reference": "523407fb06eb9e5f3d59889b3978d5bfe94299c8", + "shasum": "" + }, + "require": { + "php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0" + }, + "require-dev": { + "cerdic/css-tidy": "^1.7 || ^2.0", + "simpletest/simpletest": "dev-master" + }, + "suggest": { + "cerdic/css-tidy": "If you want to use the filter 'Filter.ExtractStyleBlocks'.", + "ext-bcmath": "Used for unit conversion and imagecrash protection", + "ext-iconv": "Converts text to and from non-UTF-8 encodings", + "ext-tidy": "Used for pretty-printing HTML" + }, + "type": "library", + "autoload": { + "files": [ + "library/HTMLPurifier.composer.php" + ], + "psr-0": { + "HTMLPurifier": "library/" + }, + "exclude-from-classmap": [ + "/library/HTMLPurifier/Language/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1-or-later" + ], + "authors": [ + { + "name": "Edward Z. Yang", + "email": "admin@htmlpurifier.org", + "homepage": "http://ezyang.com" + } + ], + "description": "Standards compliant HTML filter written in PHP", + "homepage": "http://htmlpurifier.org/", + "keywords": [ + "html" + ], + "support": { + "issues": "https://github.com/ezyang/htmlpurifier/issues", + "source": "https://github.com/ezyang/htmlpurifier/tree/v4.16.0" + }, + "time": "2022-09-18T07:06:19+00:00" + }, { "name": "firebase/php-jwt", "version": "v6.5.0", diff --git a/config/bundles.php b/config/bundles.php index 25574618fcf75c1795c12c8d4a297f09de7e7d62..5428881079869d65fa3b5a61964bf80f0b73b973 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -1,31 +1,32 @@ <?php return [ - Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true], - Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], - Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true], - Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true], - Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], - Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], - Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true], - Nelmio\Alice\Bridge\Symfony\NelmioAliceBundle::class => ['dev' => true, 'test' => true], - Fidry\AliceDataFixtures\Bridge\Symfony\FidryAliceDataFixturesBundle::class => ['dev' => true, 'test' => true], - Hautelook\AliceBundle\HautelookAliceBundle::class => ['dev' => true, 'test' => true], - Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], - Knp\DictionaryBundle\KnpDictionaryBundle::class => ['all' => true], - Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true], - Knp\Bundle\GaufretteBundle\KnpGaufretteBundle::class => ['all' => true], + Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true], + Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], + Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true], + Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true], + Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], + Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], + Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true], + Nelmio\Alice\Bridge\Symfony\NelmioAliceBundle::class => ['dev' => true, 'test' => true], + Fidry\AliceDataFixtures\Bridge\Symfony\FidryAliceDataFixturesBundle::class => ['dev' => true, 'test' => true], + Hautelook\AliceBundle\HautelookAliceBundle::class => ['dev' => true, 'test' => true], + Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], + Knp\DictionaryBundle\KnpDictionaryBundle::class => ['all' => true], + Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true], + Knp\Bundle\GaufretteBundle\KnpGaufretteBundle::class => ['all' => true], Rollerworks\Bundle\PasswordStrengthBundle\RollerworksPasswordStrengthBundle::class => ['all' => true], - FOS\CKEditorBundle\FOSCKEditorBundle::class => ['all' => true], - Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true], - Knp\Bundle\SnappyBundle\KnpSnappyBundle::class => ['all' => true], - ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true], - Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle::class => ['all' => true], - Craue\FormFlowBundle\CraueFormFlowBundle::class => ['all' => true], - Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true], + FOS\CKEditorBundle\FOSCKEditorBundle::class => ['all' => true], + Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true], + Knp\Bundle\SnappyBundle\KnpSnappyBundle::class => ['all' => true], + ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true], + Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle::class => ['all' => true], + Craue\FormFlowBundle\CraueFormFlowBundle::class => ['all' => true], + Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true], FriendsOfBehat\SymfonyExtension\Bundle\FriendsOfBehatSymfonyExtensionBundle::class => ['test' => true], - DAMA\DoctrineTestBundle\DAMADoctrineTestBundle::class => ['test' => true], - Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true], - KnpU\OAuth2ClientBundle\KnpUOAuth2ClientBundle::class => ['all' => true], - Knp\Bundle\TimeBundle\KnpTimeBundle::class => ['all' => true], + DAMA\DoctrineTestBundle\DAMADoctrineTestBundle::class => ['test' => true], + Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true], + KnpU\OAuth2ClientBundle\KnpUOAuth2ClientBundle::class => ['all' => true], + Knp\Bundle\TimeBundle\KnpTimeBundle::class => ['all' => true], + Exercise\HTMLPurifierBundle\ExerciseHTMLPurifierBundle::class => ['all' => true], ]; diff --git a/config/packages/exercise_html_purifier.yaml b/config/packages/exercise_html_purifier.yaml new file mode 100644 index 0000000000000000000000000000000000000000..4c787a58ee3783eb7334dbfd05fd5af5e61403cc --- /dev/null +++ b/config/packages/exercise_html_purifier.yaml @@ -0,0 +1,21 @@ +exercise_html_purifier: + default_cache_serializer_path: '%kernel.cache_dir%/htmlpurifier' + + html_profiles: + default: + config: + # the charset used by the original contents + Core.Encoding: 'UTF-8' + # full configuration reference: http://htmlpurifier.org/live/configdoc/plain.html + +# Read the https://github.com/Exercise/HTMLPurifierBundle/blob/master/README.md file +# to know how to whitelist elements + +# # whitelist attributes by tag +# attributes: [] + +# # whitelist elements by name +# elements: [] + +# # list of elements that cannot have attributes +# blank_elements: [] diff --git a/src/Domain/AIPD/Form/Type/AnalyseCriterePrincipeFondamentalType.php b/src/Domain/AIPD/Form/Type/AnalyseCriterePrincipeFondamentalType.php index 9baabdefa078da7ca30b193d3338ab82a36beefd..25562de3bbecd3f773280b22be698e4ad03a07f5 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 1d0e69a2e17939486749ba4243dc9cc96f497a39..87d7200896eead4c8e1304e0e320f339f3377b6e 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 74c359e7c1b6770140eb72590d4b47a4a80cd88d..224f9f99a19c38b7f6b6ae1d6296f05b8d3d950f 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 a87128b1cbe4114ef75385b948e846d8b6233327..4b583f3de1eb0f1194ff6a2aed7ad056ac319ed9 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 b08caff01481d81df35afc46f123647dc243adac..383a57fbdf0418054703c526ce85334a8cb2324c 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 f82a206a02be35b5b6394c87659f73fdc99bb1f4..de74cc18eb78670cd977dddc7e3ab3337d2e5c4c 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 2a02c655a39740b21d27a84e79a129aa0eaf6f48..ac8b4fdc0546824727c4d0db4ac62c5f448d8ccb 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 47b2f51c5d022d31c7cce66f08781fae9b7ef04b..8d87242bfe541abb3c67c2ba1e934ff0d8684ad3 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 57d6964a3393b2ad75d3367801b276c718639bb1..9d32ca1352ee1f2ccf69e8551337e076a86faec1 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 acb60e44342cefb28c6bfbc308a82fea9d85cdfb..4ed9e67f49c7f03ce1366273aa406e62261de873 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 7fa63b95db815bd97e0a14134ae96318aa5317bb..d0723869d7e344b648f64b609898151d6efac024 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 795fd19a8c671b1bf9ebdf4355b2bdf5eb5a3ad8..07fc6df9d19a9a6e3880b8b4b195e64f73c2f2ec 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 33828d0db88b59ee60c5dbf62ddec787ed2ef50f..e0b4af71128f75be48050694261f2ca42e0d98df 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 d97e01682deb0254db6363a872faf00eb1dfbc26..91a8d480a0214c80e11b99ece87fb2fa1bd5583d 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 a1cfb4d1b62a34a56753fbae9a965a9de8a365d8..e26c20824ffe13c037fe85d64d40f80a9ee88fdb 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 b4373617d4d1c043aaffc9096bba865786391ad8..eafc57c9e9d87e4f31d905d20b180f94de14999f 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 cffb755d9649b790abe8866b326da1f0a723d3a1..da82e1d0bfcc25e440e6461ad8acd4b4111dcf47 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 a3676e753cd705d834888f4c9f987f2bbeb3683d..69fc21e0f028389b87d99384f9802de1a9424158 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 46e8ad9a6c393960be035e8d7d09f5090002c4e9..01aa0fe89e784272f0a378e5aea5f8f4306391f3 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 9f0e90bc69435defa1dfb9c25c5f4002434ade6e..b1577d3a9fdbcb7bc24ae0b2540eeaf52056e7c5 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 6aefda9d108e1d7c0bda5207e317fa88ef04ba55..4b40835bc8d9d346475a091353175c366de7d0e0 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 18e64651c23541f9414084d7d5fe75bdf466ee85..5005302aff30f68da146ad9c462162ac573a465e 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 49b3802f502f8ea1803b2f1d35df6aca0affdb6d..0f2541abfef81a4fac19983239023c91c0049728 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 0b1123d4fbc6ce2bebff10fe2c876ba4cee9cabe..f413041d7b4c9107509d3a83f99b503644577f67 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 85962668984ab064e6b7c0e2be7d4484e8db22e9..f94a9c1d975b8de62b209321f9c0dab1f801184f 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 d7a3945eadc0dfe7986c0800fd72ec5beabbbf37..7875ee75c5ef582a8319f863c90d1c12739fb311 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 4ecbb3a82a3248a4313ad1786566d9ff016285e5..a1e87d7c07cca8b7d90358ad4d2840d89378a624 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 8491cbebd8ec438fe07bd4d50689dbffb4f647aa..25a43eddadf3cf4ae515b2b898315574d23e447d 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 59b6d63daa4731baec32069677448f55286c575a..a9279abf6e4d54b41feb1c3e601c7db128e02bdc 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 905f26d100158dc573b4d517f13bcb85069fad80..3c0862aab1b4ac1c57ba2e774e229dece2622a8f 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 d18aaa5bc483d5f5496c8be85af5b79dc8e3a7f7..fbb989b67019cfce0705aaf613166cef3266d134 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 ce1790b14d60ff3cbf02d01afb09902ba071ec0a..987482185789ace37abf8db9e2d7eeade167ac4c 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 085812993f5a316bab0bd9214b44f530bb30b929..1ec5e05fc0e4a1e61bc3062e54d8fa3c16f01a3d 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 3eeb94ea91abff81df9c03d399fba7cc09092599..7e18e35ab982e290d36d658cadad0a0d1b70432a 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', diff --git a/symfony.lock b/symfony.lock index a510f6cff82abffbf1bee458a43fde8a3261150a..115e1c132e0898fc7dc18860d27aa7d5bc131c3e 100644 --- a/symfony.lock +++ b/symfony.lock @@ -130,6 +130,18 @@ "egulias/email-validator": { "version": "2.1.4" }, + "exercise/htmlpurifier-bundle": { + "version": "4.1", + "recipe": { + "repo": "github.com/symfony/recipes-contrib", + "branch": "main", + "version": "3.0", + "ref": "99590c5352b58fadacd5535337589aba7e44f5a7" + }, + "files": [ + "./config/packages/exercise_html_purifier.yaml" + ] + }, "friends-of-behat/symfony-extension": { "version": "2.4", "recipe": {