Skip to content

Commit

Permalink
Merge branch 'patch-1' of https://github.com/stealth35/zf2 into hotfi…
Browse files Browse the repository at this point in the history
…x/php-53-updates
  • Loading branch information
weierophinney committed May 20, 2011
2 parents bd5e3e7 + 6caafab commit 52eacb2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 23 deletions.
6 changes: 2 additions & 4 deletions library/Zend/Date/DateObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -1017,10 +1017,8 @@ public function setTimezone($zone = null)
}

// throw an error on false input, but only if the new date extension is available
if (function_exists('timezone_open')) {
if (!@timezone_open($zone)) {
throw new Exception\InvalidArgumentException("timezone ($zone) is not a known timezone");
}
if (!@timezone_open($zone)) {
throw new Exception\InvalidArgumentException("timezone ($zone) is not a known timezone");
}
// this can generate an error if the date extension is not available and a false timezone is given
$result = @date_default_timezone_set($zone);
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Mail/Storage/Writable/Maildir.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@ public function renameFolder($oldName, $newName)
protected function _createUniqueId()
{
$id = '';
$id .= function_exists('microtime') ? microtime(true) : (time() . ' ' . rand(0, 100000));
$id .= '.' . (function_exists('posix_getpid') ? posix_getpid() : rand(50, 65535));
$id .= microtime(true);
$id .= '.' . getmypid();
$id .= '.' . php_uname('n');

return $id;
Expand Down
18 changes: 1 addition & 17 deletions library/Zend/Validator/EmailAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,18 +242,6 @@ public function setHostnameValidator(Hostname $hostnameValidator = null, $allow
return $this;
}

/**
* Whether MX checking via getmxrr is supported or not
*
* This currently only works on UNIX systems
*
* @return boolean
*/
public function validateMxSupported()
{
return function_exists('getmxrr');
}

/**
* Returns the set validateMx option
*
Expand All @@ -274,10 +262,6 @@ public function getValidateMx()
*/
public function setValidateMx($mx)
{
if ((bool) $mx && !$this->validateMxSupported()) {
throw new Exception\InvalidArgumentException('MX checking not available on this system');
}

$this->_options['mx'] = (bool) $mx;
return $this;
}
Expand Down Expand Up @@ -441,7 +425,7 @@ private function _validateMXRecords()
$result = getmxrr($this->_hostname, $mxHosts);
if (!$result) {
$this->_error(self::INVALID_MX_RECORD);
} else if ($this->_options['deep'] && function_exists('checkdnsrr')) {
} else if ($this->_options['deep']) {
$validAddress = false;
$reserved = true;
foreach ($mxHosts as $hostname) {
Expand Down

0 comments on commit 52eacb2

Please sign in to comment.