Skip to content

Commit

Permalink
Merge pull request #337 from nanasess/fix-returnpath
Browse files Browse the repository at this point in the history
improve/php7 のマージ漏れ
  • Loading branch information
chihiro-adachi authored Nov 21, 2019
2 parents 0aee1bc + 9917785 commit b92af08
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions data/class/SC_SendMail.php
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,11 @@ public function getBackendParams($backend)
switch ($backend) {
case 'mail':
$arrParams = array();
$objDb = new SC_Helper_DB_Ex();
$objSite = $objDb->sfGetBasisData();
if (!empty($objSite['email04']) && strpos($objSite['email04'], '@') > 0) {
$arrParams[] = "-f ".$objSite['email04'];
}
break;

case 'sendmail':
Expand Down
11 changes: 10 additions & 1 deletion tests/class/SC_SendMailTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,18 @@ public function testGetRecip()
$this->verify();
}

/**
* @runInSeparateProcess
* @preserveGlobalState disabled
*/
public function testGetBackendParams()
{
$this->expected = [];
$this->objQuery->update('dtb_baseinfo', ['email04' => 'test@example.com']);
$objDb = new SC_Helper_DB_Ex();
$objSite = $objDb->sfGetBasisData();
$this->expected = [
'-f '.$objSite['email04']
];
$this->actual = $this->objSendMail->getBackendParams('mail');
$this->verify();

Expand Down

0 comments on commit b92af08

Please sign in to comment.