How do you understand that after encoding, HTML-encoded text contains only ampersands, half-columns and alphanumeric characters?
I can really encode "" in HTML - and this is one of the things that need to be solved in order to deal with the problem (since it is a line separator in SQL).
Thus, it works ONLY if you put HTML-encoded text in the database.
THEN you have some problems with any text search ... and the presentation of readable text outside (e.g. in SQL Manager). I would think that a very bad architectural situation, since you did not solve the problem, just dragged away an obvious attack vector.
Numeric fields are still problematic if your HTML processing is not perfect, and I did not expect this to be a workaround.
Use SQL parameters;)
Tomtom
source share