Hi Dave -

I really don't understand why ('' == valid email).  Could you explain why it
is intentional that that sort of validation is intentional?

I've changed the code over to used the apache commons validator class which
does a much more extensive testing.  In doing so, I preserved the requireDot
functionality.  I've opened up Jira issue 668 and will include the patch
today.  I'll leave the empty condition in place.

https://issues.apache.org/jira/browse/OFBIZ-668

Thanks,

John

On 1/29/07, David E. Jones <[EMAIL PROTECTED]> wrote:


On Jan 29, 2007, at 10:42 AM, John Martin wrote:

> On more careful examination of the isEmail function, the first test
> is to
> see if the string is empty and if so it returns true.  I can't
> imagine why
> that condition should return true, null or an empty string do not
> constitute
> an email address.  My only thought for a reason would be if the
> field being
> tested is an optional field.  In that case it shouldn't be the
> responsibility of the function but the form handler.
>
> The function should return an absolute true/false that the string
> is an
> email and not.
>
> Comments?

You'll find this pattern throughout and it is VERY intentional. Only
the not empty constraint requires a non-empty string, and that's the
way it's supposed to be, otherwise you get weird and very confusing
error messages.

Committers please read: don't ever change this, it is VERY intentional!

-David




Reply via email to