Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixing issues with old method names being used in EmailComponent.

  • Loading branch information...
commit 7384f56144ffcf5d635d7ca6bf7693d4a2eacb1f 1 parent 6c3c5e9
@markstory markstory authored
View
26 cake/libs/controller/components/email.php
@@ -513,11 +513,11 @@ function _createboundary() {
* @access public
* @param array Associative array containing headers to be set.
*/
- function header($headers) {
- foreach ($headers as $header => $value) {
- $this->__header[] = sprintf('%s: %s', trim($header), trim($value));
- }
- }
+ function header($headers) {
+ foreach ($headers as $header => $value) {
+ $this->__header[] = sprintf('%s: %s', trim($header), trim($value));
+ }
+ }
/**
* Create emails headers including (but not limited to) from email address, reply to,
* bcc and cc.
@@ -529,12 +529,12 @@ function _createHeader() {
if ($this->delivery == 'smtp') {
if (is_array($this->to)) {
- $this->__header[] = 'To: ' . implode(', ', array_map(array($this, '__formatAddress'), $this->to));
+ $headers['To'] = implode(', ', array_map(array($this, '_formatAddress'), $this->to));
} else {
- $this->__header[] = 'To: ' . $this->__formatAddress($this->to);
+ $headers['To'] = $this->_formatAddress($this->to);
}
}
- $this->__header[] = 'From: ' . $this->__formatAddress($this->from);
+ $headers['From'] = $this->_formatAddress($this->from);
if (!empty($this->replyTo)) {
$headers['Reply-To'] = $this->_formatAddress($this->replyTo);
@@ -763,14 +763,14 @@ function _mail() {
$header = implode("\n", $this->__header);
$message = implode("\n", $this->__message);
if (is_array($this->to)) {
- $to = implode(', ', array_map(array($this, '__formatAddress'), $this->to));
+ $to = implode(', ', array_map(array($this, '_formatAddress'), $this->to));
} else {
$to = $this->to;
}
if (ini_get('safe_mode')) {
- return @mail($to, $this->__encode($this->subject), $message, $header);
+ return @mail($to, $this->_encode($this->subject), $message, $header);
}
- return @mail($to, $this->__encode($this->subject), $message, $header, $this->additionalParams);
+ return @mail($to, $this->_encode($this->subject), $message, $header, $this->additionalParams);
}
/**
@@ -829,7 +829,7 @@ function _smtp() {
$tos = $this->to;
}
foreach ($tos as $to) {
- if (!$this->__smtpSend('RCPT TO: ' . $this->__formatAddress($to, true))) {
+ if (!$this->_smtpSend('RCPT TO: ' . $this->_formatAddress($to, true))) {
return false;
}
}
@@ -897,7 +897,7 @@ function _debug() {
$fm = '<pre>';
if (is_array($this->to)) {
- $to = implode(', ', array_map(array($this, '__formatAddress'), $this->to));
+ $to = implode(', ', array_map(array($this, '_formatAddress'), $this->to));
} else {
$to = $this->to;
}
View
2  cake/tests/cases/libs/controller/components/email.test.php
@@ -303,7 +303,7 @@ function testSmtpSend() {
* @return void
*/
function testSmtpSendMultipleTo() {
- if (!$this->skipIf(!fsockopen('localhost', 25), '%s No SMTP server running on localhost')) {
+ if (!$this->skipIf(!@fsockopen('localhost', 25), '%s No SMTP server running on localhost')) {
return;
}
$this->Controller->EmailTest->reset();
Please sign in to comment.
Something went wrong with that request. Please try again.