Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Avoid undefined index if not define timeout in EmailComponent. Fixes #…

  • Loading branch information...
commit b480d80c825fdbb1fee892b1ec18f8483e832f4d 1 parent 7682c58
@jrbasso jrbasso authored
Showing with 8 additions and 4 deletions.
  1. +8 −4 cake/libs/controller/components/email.php
View
12 cake/libs/controller/components/email.php
@@ -228,9 +228,7 @@ class EmailComponent extends Object{
* @access public
* @link http://book.cakephp.org/view/1290/Sending-A-Message-Using-SMTP
*/
- var $smtpOptions = array(
- 'port'=> 25, 'host' => 'localhost', 'timeout' => 30
- );
+ var $smtpOptions = array();
/**
* Placeholder for any errors that might happen with the
@@ -789,7 +787,13 @@ function _mail() {
function _smtp() {
App::import('Core', array('CakeSocket'));
- $this->__smtpConnection =& new CakeSocket(array_merge(array('protocol'=>'smtp'), $this->smtpOptions));
+ $defaults = array(
+ 'host' => 'localhost',
+ 'port' => 25,
+ 'protocol' => 'smtp',
+ 'timeout' => 30
+ );
+ $this->__smtpConnection =& new CakeSocket(array_merge($defaults, $this->smtpOptions));
if (!$this->__smtpConnection->connect()) {
$this->smtpError = $this->__smtpConnection->lastError();
Please sign in to comment.
Something went wrong with that request. Please try again.