Home » Validate » Validate » Bug #6930
Email validation via ::multiple always checks domain
Details
| Submitted | 2006-02-25 01:18 UTC |
|---|---|
| From | nhyde at bigdrift dot com |
| Assigned | pajoye |
| Status | Closed |
| Package | Validate |
| PHP Version | 4.4.1 |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2006-02-25 01:18 UTC] nhyde at bigdrift dot com
Description:
------------
When running Validate::multiple on an email type, if a parameter is passed in the options, a domain check will be performed, regardless of the value of the first parameter.
A patchfile, xdebug 2beta5 cachegrind output for before and after the patch and an updated phpt test is available in http://www.bigdrift.com/pear/validate/
Test script:
---------------
<?php
require 'Validate.php';
$aValues = array('emailAddress' => 'support@honesttowing.com');
$aOptions = array('emailAddress' => array('type'=>'email'
,array('check_domain'=>false)));
$valid = Validate::multiple($aValues,$aOptions);
$multiWithoutDomain = $valid['emailAddress'];
$aOptions = array('emailAddress' => array('type'=>'email',array('check_domain'=>true)));
$valid = Validate::multiple($aValues,$aOptions);
$multiWithDomain = $valid['emailAddress'];
$withoutDomain = Validate::email($aValues['emailAddress'],false);
print 'Multiple, without check_domain: '.$multiWithoutDomain."\n";
print 'Multiple, with check_domain: '.$multiWithDomain."\n";
print 'Direct, without check_domain: '.$withoutDomain."\n";
?>
Expected result:
----------------
Multiple without check_domain would return true, as a direct call to email, with check_domain = false;
Multiple, without check_domain: 1
Multiple, with check_domain:
Direct, without check_domain: 1