0

I am storing emojis into a custom table and querying the content using wpdb variable. The database charset is utf8mb4 and collation is utf8mb4_general_ci

Emoji are stored as it is as the user enters them. What security issues can i face here and what things should i keep in mind to avoid any situation that could compromise my data. Also can user insert some random mysql/php code in input, should i sanitize it, encode it and then store. Also if i do encode at what stage should i decode it to present to ui.

0

As with all user input, you will want to sanitize before storing the input, sanitize on display, and sanitize any user input used in queries. If you're limiting it strictly to emojis, I would also recommend validating and restricting input to only emojis.

| improve this answer | |
  • Thank you, makes sense. – Pawan Saxena Oct 18 '19 at 19:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.