Use htmlentities with editor

Use htmlentities with editor

srushasrusha Posts: 4Questions: 1Answers: 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: 4Questions: 1Answers: 0

    Nothing?

  • allanallan Posts: 49,068Questions: 1Answers: 7,175 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

Sign In or Register to comment.