Skip to content
Browse files

EmailComponent::reset now empties out attachments array. Fixes #6498.

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8226 3807eeeb-6ff5-0310-8944-8be069107fe0
  • Loading branch information...
1 parent fb6b16c commit 4f44a154701f0014a91d4825177877c9b2f9138b @jperras jperras committed
View
1 cake/libs/controller/components/email.php
@@ -346,6 +346,7 @@ function reset() {
$this->subject = null;
$this->additionalParams = null;
$this->smtpError = null;
+ $this->attachments = array();
$this->__header = array();
$this->__boundary = null;
$this->__message = array();
View
2 cake/tests/cases/libs/controller/components/email.test.php
@@ -574,6 +574,7 @@ function testReset() {
$this->Controller->EmailTest->additionalParams = 'X-additional-header';
$this->Controller->EmailTest->delivery = 'smtp';
$this->Controller->EmailTest->smtpOptions['host'] = 'blah';
+ $this->Controller->EmailTest->attachments = array('attachment1', 'attachment2');
$this->assertFalse($this->Controller->EmailTest->send('Should not work'));
@@ -592,6 +593,7 @@ function testReset() {
$this->assertNull($this->Controller->EmailTest->getBoundary());
$this->assertIdentical($this->Controller->EmailTest->getMessage(), array());
$this->assertNull($this->Controller->EmailTest->smtpError);
+ $this->assertIdentical($this->Controller->EmailTest->attachments, array());
}
/**
* osFix method

0 comments on commit 4f44a15

Please sign in to comment.
Something went wrong with that request. Please try again.