/
Using php build-in validation

Using php build-in validation

Imported From: http://groups.google.com/group/in-portal-dev/browse_thread/thread/910e2b54ba937de4#

There is nice filter_var function (http://php.net/manual/en/function.filter-var.php), that can be used to do user input validation/sanitize. For example these validating are already there and there is no need to do them manually each time:

  • IP address
  • url
  • e-mail
  • regexp

To benefit from these filters I'm proposing to add 2 optional options to field definition: 

  • filter_type - constant, that represents build-in filter
  • filter_options - extra options (if any), that used filter type accepts

And maybe we need to move regexp validation to later stage (when whole validation routing takes place). I know I talked about this before, but don't remember was there any progress in doing that or not.

Related Tasks