Last Updated: February 25, 2016
·
518
· galvao

Use PHP's native Filter and Validation functions!

This should be obvious, but there is a lot of people out there that still ignore this, either because they don't know it exists (the very reason why I'm writing this) or because they insist in creating their own code<sup>1</sup>.

Since PHP 5.2.0 (released in 2006!) the language has a native "family" of functions to deal with the extremely difficult job of validating and filtering data:

http://php.net/manual/en/book.filter.php

(1) I'm all for reinventing the wheel (under certain conditions), but people often do it wrong when it comes to security.

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Related Tags
#php
#security
Did you know?

PHP applications still send a browser full of JavaScript. Hardening the server does not inventory the payment, analytics, and plugin scripts that run after the HTML is delivered.

Security insights from Cside