PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTML » HTML_QuickForm » Bug #6911

email validation fails

Details

Submitted2006-02-23 18:38 UTC
Fromsandro at sandro dot org
StatusWont fix
PackageHTML_QuickForm
PHP Version4.3.9
OSSunOS 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