Skip Menu |

This queue is for tickets about the Data-FormValidator CPAN distribution.

Maintainer(s)' notes

This is the bug queue for Data::FormValidator.

Report information
The Basics
Id: 14046
Status: resolved
Priority: 0/
Queue: Data-FormValidator

People
Owner: MARKSTOS [...] cpan.org
Requestors: frank.maas [...] cheiron-it.nl
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 3.71
Fixed in: (no value)



Subject: filter applied before constraint check
Hi, I just found out (the hard way) that filters are applied before constraints are checked. Now I must say that I did not look into the theoretical matter deep enough to argue with this choice. But I found a side-effect that is unwanted... The builtin constraint 'email' does not recognize valid addresses if one uses the builtin filter 'quotemeta'. The latter will escape dots and the at-sign, but the escape-sign is not in the email regexp. Hence the input is disqualified. Best regards, Frank
Date: Sun, 7 Aug 2005 20:47:05 -0500
From: Mark Stosberg <mark [...] summersault.com>
To: Guest via RT <bug-Data-FormValidator [...] rt.cpan.org>
Subject: Re: [cpan #14046] filter applied before constraint check
RT-Send-Cc:
Frank -- On Sun, Aug 07, 2005 at 07:11:55PM -0400, Guest via RT wrote: Show quoted text
> > I just found out (the hard way) that filters are applied before > constraints are checked.
If you don't feel that's documented clearly enough, I would accept a "doc patch" Show quoted text
> Now I must say that I did not look into the > theoretical matter deep enough to argue with this choice. But I found > a side-effect that is unwanted... The builtin constraint 'email' does > not recognize valid addresses if one uses the builtin filter > 'quotemeta'. The latter will escape dots and the at-sign, but the > escape-sign is not in the email regexp. Hence the input is > disqualified.
Transforming data before constraints get to them is what filters are supposed to do. One possible outcome of this is that the filters transform the data so that they don't pass constraints. In your case, it sounds like both the filter and constraint were working as documented, so I don't consider this interaction a bug. Are you proposing a specific resolution here? Mark -- http://mark.stosberg.com/