Use htmlentities with editor

Use htmlentities with editor

srushasrusha Posts: 5Questions: 2Answers: 0

Hi,
For reasons, I need all editor input to go through htmlentities($string,ENT_QUOTES,'UTF-8');
I know I can do it manually and edit each and every one of my fields set function callbacks but this means 100+ fields to go through. is there a way to automatically convert ALL data that is going to the SQL using htmlentities? so that instead of " in the database I will have &qoute;?

Answers

  • srushasrusha Posts: 5Questions: 2Answers: 0

    Nothing?

  • allanallan Posts: 63,471Questions: 1Answers: 10,467 Site admin

    Two options:

    1. You could add a set formatter to each field (that could be done programmatically if you didn't want to add that line for each field's definition.
    2. Loop over the input POST data and encode each value there before passing it on to Editor.

    Remember to be careful of double encoding when submitting the encoded data again :).

    Allan

This discussion has been closed.