fortrabbit / datafilter

A data validation (sanitation) module for PHP
MIT License
10 stars 4 forks source link

Prefiltering only some attribs #3

Open micmath opened 11 years ago

micmath commented 11 years ago

If I have two attribs in a single profile, say realname and username, and I want to prefilter the submitted values, such that the realname is trimmed only, and the the username is lowercased and trimmed, I don't see any way to do this with the available prefilter API.

Any prefilter function I add is only ever given the submitted value and I can't see any way to detect if that value refers to, say, the realname attrib or the username attrib.

Am I missing some obvious way to do this or, if not, is it worth considering as a feature request, that the name of the attrib be provided to the prefilter, along with the value?