Comment whitelist juste quelques attributs avec htmlpurifier?
-
21-08-2019 - |
Question
Comment whitelist juste quelques attributs avec htmlpurifier? Je veux htmlpurifier de supprimer tous les autres, les attributs non autorisés.
La solution
HTML.AllowedAttributes . Notez que lors de l'utilisation HTML.AllowedAttributes, vous devez être aussi à l'aide HTML.AllowedElements . Et vous aurez probablement besoin d'ajouter plus que vous allez le long . Comme pour AllowedFrameTargets
target=""
, AllowedRel
, AllowedRev
, EnableAttrID
, ... Pas beaucoup de choix mais de tester à fond.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow