Skip to content

Commit

Permalink
https://github.com/opencart/opencart/issues/14029
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkerr committed Jul 3, 2024
1 parent e2dd16a commit 1ba8c61
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions upload/system/library/mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Class Mail
*/
class Mail {
private string $adaptor;
private string $class;
/**
* @var array<string, mixed>
*/
Expand All @@ -29,7 +29,7 @@ public function __construct(string $adaptor = 'mail', array $option = []) {
$class = 'Opencart\System\Library\Mail\\' . $adaptor;

if (class_exists($class)) {
$this->adaptor = $adaptor;
$this->class = $class;
$this->option = $option;
} else {
throw new \Exception('Error: Could not load mail adaptor ' . $adaptor . '!');
Expand Down Expand Up @@ -150,7 +150,7 @@ public function send(): bool {
throw new \Exception('Error: E-Mail message required!');
}

$mail = new $this->adaptor($this->option);
$mail = new $this->class($this->option);

return $mail->send();
}
Expand Down
4 changes: 2 additions & 2 deletions upload/system/library/mail/mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class Mail {
*
* @param array<string, mixed> $option
*/
public function __construct(array &$option = []) {
$this->option = &$option;
public function __construct(array $option = []) {
$this->option = $option;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions upload/system/library/mail/smtp.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ class Smtp {
*
* @param array<string, mixed> $option
*/
public function __construct(array &$option = []) {
public function __construct(array $option = []) {
foreach ($this->default as $key => $value) {
if (!isset($option[$key])) {
$option[$key] = $value;
}
}

$this->option = &$option;
$this->option = $option;
}

/**
Expand Down

0 comments on commit 1ba8c61

Please sign in to comment.