Answer the question
In order to leave comments, you need to log in
Text filtering feature?
Hello.
Can you suggest a function or a set of functions to adequately filter the text sent by the user (from SQL injections, html codes, single quotes, etc.)
I know that there are strip_tags and other methods, but maybe someone wrote or found a function to clean up the code from unnecessary ?
I wrote a couple of modules for the engine, but after going through the security I found a lot of errors. For example, if you send a single quote, we get a MySQL Fatal Error, we had to write a regular expression, but then send a backslash with a quote - the same problem occurs.
In other words, it is not able to foresee all errors, therefore, in search of a suitable function.
Thanks in advance.
Answer the question
In order to leave comments, you need to log in
Use PDO, or mysqli_escape_string to write to the database, this will be enough.
You can also use HTML Purifier if you need "something more than".
Can you suggest a function or a set of functions to adequately filter the text sent by the user (from SQL injections, html codes, single quotes, etc.)Can not be.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question