"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "framework/validators/CEmailValidator.php" between
yii-1.1.18.018a89.tar.gz and yii-1.1.19.5790cb.tar.gz

About: Yii is a high-performance component-based PHP framework for developing large-scale Web applications.

CEmailValidator.php  (yii-1.1.18.018a89):CEmailValidator.php  (yii-1.1.19.5790cb)
skipping to change at line 51 skipping to change at line 51
*/ */
public $checkMX=false; public $checkMX=false;
/** /**
* @var boolean whether to check port 25 for the email address. * @var boolean whether to check port 25 for the email address.
* Defaults to false. To enable it, ensure that the PHP functions 'dns_ge t_record' and * Defaults to false. To enable it, ensure that the PHP functions 'dns_ge t_record' and
* 'fsockopen' are available in your PHP installation. * 'fsockopen' are available in your PHP installation.
* Please note that this check may fail due to temporary problems even if email is deliverable. * Please note that this check may fail due to temporary problems even if email is deliverable.
*/ */
public $checkPort=false; public $checkPort=false;
/** /**
* @var null|int timeout to use when attempting to open connection to por
t in checkMxPorts. If null (default)
* use default_socket_timeout value from php.ini. If not null the timeout
is set in seconds.
* @since 1.1.19
*/
public $timeout=null;
/**
* @var boolean whether the attribute value can be null or empty. Default s to true, * @var boolean whether the attribute value can be null or empty. Default s to true,
* meaning that if the attribute is empty, it is considered valid. * meaning that if the attribute is empty, it is considered valid.
*/ */
public $allowEmpty=true; public $allowEmpty=true;
/** /**
* @var boolean whether validation process should care about IDN (interna tionalized domain names). Default * @var boolean whether validation process should care about IDN (interna tionalized domain names). Default
* value is false which means that validation of emails containing IDN wi ll always fail. * value is false which means that validation of emails containing IDN wi ll always fail.
* @since 1.1.13 * @since 1.1.13
*/ */
public $validateIDN=false; public $validateIDN=false;
skipping to change at line 159 skipping to change at line 165
* is opened on any of these. * is opened on any of these.
* @since 1.1.11 * @since 1.1.11
* @param string $domain domain to be checked * @param string $domain domain to be checked
* @return boolean true if a reachable MX server has been found * @return boolean true if a reachable MX server has been found
*/ */
protected function checkMxPorts($domain) protected function checkMxPorts($domain)
{ {
$records=dns_get_record($domain, DNS_MX); $records=dns_get_record($domain, DNS_MX);
if($records===false || empty($records)) if($records===false || empty($records))
return false; return false;
$timeout=is_int($this->timeout)?$this->timeout:((int)ini_get('def ault_socket_timeout'));
usort($records,array($this,'mxSort')); usort($records,array($this,'mxSort'));
foreach($records as $record) foreach($records as $record)
{ {
$handle=@fsockopen($record['target'],25); $handle=@fsockopen($record['target'],25,$errno,$errstr,$t imeout);
if($handle!==false) if($handle!==false)
{ {
fclose($handle); fclose($handle);
return true; return true;
} }
} }
return false; return false;
} }
/** /**
 End of changes. 3 change blocks. 
1 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)