Replace use of 'array_merge' with the spread operator and 'array_push' in various places.
This isn't supported for arrays with string keys until PHP 8.1. https://wiki.php.net/rfc/spread_operator_for_array
This commit is contained in:
@@ -45,7 +45,7 @@ class Mailer {
|
||||
|
||||
$headers = [ "From: $from_combined", "Content-Type: text/plain; charset=UTF-8" ];
|
||||
|
||||
$rc = mail($to_combined, $subject, $message, implode("\r\n", array_merge($headers, $additional_headers)));
|
||||
$rc = mail($to_combined, $subject, $message, implode("\r\n", [...$headers, ...$additional_headers]));
|
||||
|
||||
if (!$rc) {
|
||||
$this->set_error(error_get_last()['message'] ?? T_sprintf("Unknown error while sending mail. Hooks tried: %d.", $hooks_tried));
|
||||
|
||||
Reference in New Issue
Block a user