Earlier quoted context omitted.
In all seriousness, shouldn't all the frameworks just have some validation built in? Being that this is such a "global" WTF problem. I would love to be able to say ini_set('sanitize_rest', true) and deal with errors that might result from that knowing at least the strings are safe. Or have functions like sanitize_string($str) and have the documentation encourage it everywhere. I mean, aren't we all just implementing…
A one-size-fits-all cannot work. Ever. For an SQL-based DB (i.e. where the data mixes with the logic in the query) you should be using parameterised queries anyway. For general data sanitisation/validation you should look at the filter_* functions.
Programmers have so much stockholm syndrome it's unbelievable.