Welcome Guest, Not a member yet? Register   Sign In
sanitize textarea input for database insertion - best practice
#1

Hello,
I thought I'd start this thread after a pretty thorough effort of searching / reading.

My Situation
I have a simple textarea that users are copy/pasting blocks of "text" (mostly from MS Word) into.
This text can contain quite a lot of extended characters, such as eacute, right slanted apostrophe's, open and closing double quotes, semi-colons, etc.

This is admin protected and not public facing.

Right now I am simply:
1.) Applying form validation (using a custom alpha callback that allows these certain characters)
2.) using the input class
3.) using CI's insert.

I attempted to use CI's $this->db->escape(), but it was double escaping some things.. for example, inserting "\r\n" into the textarea fields (when updating), and adding starting / ending single quotes.

Anyway, what is 'Best Practice' for this type of situation?  Should be doing any more sanitizing beyond my 3 steps above?

Thanks!,
Donovan
Reply


Messages In This Thread
sanitize textarea input for database insertion - best practice - by dbrooke - 06-26-2019, 01:22 PM



Theme © iAndrew 2016 - Forum software by © MyBB