Skip to content

Commit aa41843

Browse files
committed
fix(backend): php warning: undefined array key 'x-profile-id'
1 parent 5d2ce88 commit aa41843

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

modules/smtp/functions.php

+8-1
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,18 @@ function send_scheduled_message($handler, $imapMailbox, $folder, $msg_id, $send_
7070
$msg_headers = $imapMailbox->get_message_headers($folder, $msg_id);
7171
$mailbox_details = $imapMailbox->get_config();
7272
try {
73-
if (empty($msg_headers['X-Schedule'])) {
73+
if (! isset($msg_headers['X-Schedule'])) {
7474
return false;
75+
} else {
76+
if (empty($msg_headers['X-Schedule'])) {
77+
return false;
78+
}
7579
}
7680

7781
if (new DateTime($msg_headers['X-Schedule']) <= new DateTime() || $send_now) {
82+
if (! isset($msg_headers['X-Profile-ID'])) {
83+
return false;
84+
}
7885
$profile = Hm_Profiles::get($msg_headers['X-Profile-ID']);
7986
if (!$profile) {
8087
$profiles = Hm_Profiles::search('server', $mailbox_details['server']);

0 commit comments

Comments
 (0)