FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=16906&edit=1

ID: 16906
Updated by: php@mamasam.net
Reported By: hm2k at php dot net
Summary: no email validation like HTML_Qu
Status: Open
Type: Feature/Change Request
Package: HTML_QuickForm2
Package Version: 0.3.0
PHP Version: Irrelevant
-Assigned To:
+Assigned To: mansion
Roadmap Versions:
New Comment:

-Assigned To:
+Assigned To: mansion



Previous Comments:
------------------------------------------------------------------------

[2010-07-09 16:45:22] hm2k

My advise would be to impliment it from HTML_QuickForm and improve.

Implementing filter_var, while better than nothing isn't exactly ideal.

------------------------------------------------------------------------

[2010-07-09 15:08:37] cweiske

While the filter_var rule is a good idea itself, is it not something I
would advise people to use for validating email addresses with QF2 -
it's a common task that requires an own rule IMO.

------------------------------------------------------------------------

[2010-07-09 11:02:27] hm2k

I wrote a whole essay on this matter:

http://www.hm2k.com/posts/what-is-a-valid-email-address

It pretty much addresses my concerns here.

------------------------------------------------------------------------

[2010-07-09 10:30:17] mansion

We could also add a new rule simply called 'filter_var' or 'filter' that
would in turn
call the function filter_var() with given parameters ? It would make
things easier
than using the callback rule. The filter extension is apparently enabled
by default
since PHP 5.2, which is our minimum version for using QF2 so it should
be ok.

The filter_var email regex is a bit difficult to read and will validate
addresses with
IPv4 or IPv6 in place of domain names which might not always be what you
expect.

At the moment, I use this regex instead :
"/^[_+a-z0-9-]+(\.[_+a-z0-9-']+)*@[a-z0-9-]+(\.[a-z0-9-]{1,})*\.([a-
z]{2,}){1}$/"

It's not perfect but it fits my needs.

------------------------------------------------------------------------

[2010-07-09 10:10:45] hm2k

It would make sense, especially as previously PHP used to base it's
FILTER_VALIDATE_EMAIL on HTML_QuickForm's regex.

Where once HTML_QuickForm was leading the way, HTML_QuickForm2 has not
filled that gap.

Let's see it return.

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://pear.php.net/bugs/bug.php?id=16906

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedNov 21, '11 at 7:53a
activeNov 21, '11 at 7:53a
posts1
users1
websitepear.php.net

1 user in discussion

Php: 1 post

People

Translate

site design / logo © 2022 Grokbase