Home » HTML » HTML_QuickForm » Bug #6911
email validation fails
Details
| Submitted | 2006-02-23 18:38 UTC |
|---|---|
| From | sandro at sandro dot org |
| Status | Wont fix |
| Package | HTML_QuickForm |
| PHP Version | 4.3.9 |
| OS | SunOS 5.9 |
| Roadmaps | (Not assigned) |
Comments
[2006-02-23 18:38 UTC] sandro at sandro dot org
Description:
------------
the built in email validation fails when an email of form
user@domain.c is submitted; that TLD can be any single valid
character but a single TLD should not validate an email
Test script:
---------------
$form = new HTML_QuickForm(accountform','post');
$form->addElement('text','email','label','');
$form->addElement('submit', null, 'Send');
$form->addRule('email','enter an email', 'required');
$form->addRule('email','enter a valid email', 'email');
if ($form->validate()) {
echo 'validated';
} else {
$form->display();
}
Expected result:
----------------
submit user@domain.c as a value and should fail validation
Actual result:
--------------
submit user@domain.c passes validation