▲ | ameixaseca 2 days ago | |||||||
Keep in mind this is PHP. There are tons of languages and frameworks made by developers who know what they are doing that do not treat everything blindly like strings. For SQL in particular, you should never build queries directly from user input - any modern database supports bind variables or parameters, which completely eliminate any need for sanitizing input. I agree with you regarding sanitization, and I'd add further that having to sanitize input for security purposes is a big sign of code smell and an overall insecure code by design. | ||||||||
▲ | daneel_w 2 days ago | parent | next [-] | |||||||
>"Keep in mind this is PHP." Has nothing to do with PHP. SQL injection mishaps is a developer problem, not a language problem. It happens everywhere. | ||||||||
| ||||||||
▲ | 9dev 2 days ago | parent | prev [-] | |||||||
And tons of such frameworks have been written in PHP; prepared statements with an adapter-agnostic database connection layer are first-class citizens in PHP. |