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.
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.
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.