How to bulletproof incoming strings

Take a look; it'll be handy.