Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BO - Signalement] Bloquer les images copiées/collées en base64 dans le contenu #3587

Merged
merged 3 commits into from
Jan 23, 2025

Conversation

numew
Copy link
Collaborator

@numew numew commented Jan 20, 2025

Ticket

#3580

Description

  • Utilisation du html sanitizer pour enregistrer le HTML de la description d'un suivi (suppression des images notamment)
  • Création d'une commande pour utiliser le sanitizer sur toute les description de suivi existantes
  • Retrait de l'utilisation du sanitizer à l'affichage (vu qu’après cette PR et le lancement de la commande tout sera propre en base)

Pré-requis

make execute-migration name=Version20250120141313 direction=up
make console app="sanitize-suivis"

Tests

  • Créer un suivi en copiant-collant des image en base64 et vérifier qu'elle sont bien nettoyé à l'enregistrement
  • S'assurer qu’après la commande les suivi contenant des liens sont toujours fonctionnels

@numew numew requested review from emilschn, sfinx13 and hmeneuvrier and removed request for sfinx13 January 20, 2025 17:02
Copy link
Collaborator

@hmeneuvrier hmeneuvrier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests OK, quelques suggestions

|replace({'&t=___TOKEN___':'/'~notification.signalement.uuid})
|replace({'?t=___TOKEN___':'/'~notification.signalement.uuid})
|replace({'?folder=_up':'/'~notification.signalement.uuid~'?variant=resize'})
|raw }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Est-ce qu'on ne ferait pas une fonction twig pour cet enchainement de replace ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

|replace({'&t=___TOKEN___':'/'~signalement.uuid})
|replace({'?t=___TOKEN___':'/'~signalement.uuid})
|replace({'?foldert&#61_up':'/'~signalement.uuid~'?variant=resize'})
|raw
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quu'on pourrait utilier ici aussi ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

tests/Functional/Manager/SuiviManagerTest.php Show resolved Hide resolved
Copy link
Collaborator

@emilschn emilschn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK lecture et tests !

Copy link
Collaborator

@hmeneuvrier hmeneuvrier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK pour moi

@numew numew force-pushed the feature/3580-sanitize-suivi-description branch from 2d8cf68 to a2d2f84 Compare January 23, 2025 09:56
Copy link

@numew numew merged commit 61d61de into develop Jan 23, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants