diff --git a/api/BusinessLogic/Emails/BasicEmailSender.php b/api/BusinessLogic/Emails/BasicEmailSender.php index 0ff5e449..d29f34af 100644 --- a/api/BusinessLogic/Emails/BasicEmailSender.php +++ b/api/BusinessLogic/Emails/BasicEmailSender.php @@ -10,10 +10,9 @@ use PHPMailer; class BasicEmailSender extends \BaseClass implements EmailSender { function sendEmail($emailBuilder, $heskSettings, $modsForHeskSettings, $sendAsHtml) { - foreach ($emailBuilder->to as $to) { - if (preg_match("/\n|\r|\t|%0A|%0D|%08|%09/", $to . $emailBuilder->subject)) { - return false; - } + $toEmails = implode(',', $emailBuilder->to); + if (preg_match("/\n|\r|\t|%0A|%0D|%08|%09/", $toEmails . $emailBuilder->subject)) { + return false; } $mailer = new PHPMailer(); diff --git a/api/autoload.php b/api/autoload.php index cf548485..4355e688 100644 --- a/api/autoload.php +++ b/api/autoload.php @@ -24,4 +24,17 @@ require_once(__DIR__ . '/../inc/custom_fields.inc.php'); // Load the ApplicationContext $builder = new \DI\ContainerBuilder(); -$applicationContext = $builder->build(); \ No newline at end of file +$applicationContext = $builder->build(); + +// Fix for getallheaders() on PHP-FPM and nginx +if (!function_exists('getallheaders')) { + function getallheaders() { + $headers = array(); + foreach ($_SERVER as $name => $value) { + if (substr($name, 0, 5) == 'HTTP_') { + $headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value; + } + } + return $headers; + } +} \ No newline at end of file diff --git a/build.php b/build.php index 1d8d87d6..1822ee00 100644 --- a/build.php +++ b/build.php @@ -1,4 +1,4 @@ new UpdateMigration('3.2.2', '3.2.1', 161), 162 => new UpdateMigration('3.2.3', '3.2.2', 162), 163 => new UpdateMigration('3.2.4', '3.2.3', 163), + 164 => new UpdateMigration('3.2.5', '3.2.4', 164), // 3.3.0 - 164 => new \v330\ServiceMessagesImprovements\CreateServiceMessageToLocationTable(164), - 165 => new \v330\ServiceMessagesImprovements\UpdateExistingServiceMessagesLocations(165), - 166 => new \v330\ServiceMessagesImprovements\AddLanguageColumnToServiceMessages(166), - 167 => new \v330\CalendarImprovements\AddBusinessHoursTable(167), - 168 => new \v330\CalendarImprovements\InsertDefaultBusinessHours(168), - 169 => new \v330\CalendarImprovements\AddShowStartTimeSetting(169), + 165 => new \v330\ServiceMessagesImprovements\CreateServiceMessageToLocationTable(165), + 166 => new \v330\ServiceMessagesImprovements\UpdateExistingServiceMessagesLocations(166), + 167 => new \v330\ServiceMessagesImprovements\AddLanguageColumnToServiceMessages(167), + 168 => new \v330\CalendarImprovements\AddBusinessHoursTable(168), + 169 => new \v330\CalendarImprovements\InsertDefaultBusinessHours(169), + 170 => new \v330\CalendarImprovements\AddShowStartTimeSetting(170), + 171 => new UpdateMigration('3.2.5', '3.2.4', 171), ); } \ No newline at end of file