> All validators except NotNull and NotBlank should treat NULL values
> (or empty values, in your case) as valid. Sorry, this is not
> documented yet.

Thanks for clarify this point. But then there's a problem with this too. I
saw that validators check for null values like:

if ( $value === null )
{
    return true;
}

But they don't check for empty values. So if the value is an empty string,
then it passes that test. That's why I added the option (didn't know that
all validators had to let the value pass if it is null or an empty strings.
Now I can remove my "required" option just changing the check ).


> Oh, this could be a bug. Can you file a ticket please?

Of course. Ticket at: http://trac.symfony-project.org/ticket/9295



Thanks for your help.

On Thu, Nov 25, 2010 at 7:43 PM, Bernhard Schussek <[email protected]>wrote:

> 2010/11/25 Gustavo Adrian <[email protected]>:
> > The problem is if I just use @IpAddress on that field and I don't enter a
> > value, it will complain because is not a valid IP either.
>
> All validators except NotNull and NotBlank should treat NULL values
> (or empty values, in your case) as valid. Sorry, this is not
> documented yet.
>
> > Then, it would always return true if you enter a string like
> > "false" or "true". Is this ok or it's handled different on a file that I
> > didn't saw yet?
>
> Oh, this could be a bug. Can you file a ticket please?
>
> Bernhard
>
> --
> Software Architect & Engineer
> Blog: http://webmozarts.com
> Twitter: http://twitter.com/webmozart
>
> --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<symfony-users%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to