diff --git a/plugins/markdown_editor/markdown_editor.php b/plugins/markdown_editor/markdown_editor.php index 5d133e556..4eb8dcaea 100644 --- a/plugins/markdown_editor/markdown_editor.php +++ b/plugins/markdown_editor/markdown_editor.php @@ -18,7 +18,7 @@ class markdown_editor extends rcube_plugin if (isset($args['message']->headers)) { $draft_info = rcmail_sendmail::draftinfo_decode($args['message']->headers->get('x-draft-info')); - $start_markdown_editor = $draft_info['markdown_editor'] === 'yes'; + $start_markdown_editor = ($draft_info['markdown_editor'] ?? '') === 'yes'; } $rcmail = rcube::get_instance(); @@ -36,7 +36,7 @@ class markdown_editor extends rcube_plugin public function save_markdown_editor_usage($args) { if (isset($_POST['_markdown_editor']) && $_POST['_markdown_editor'] === '1') { - $draft_info = rcmail_sendmail::draftinfo_decode($args['message']->headers()['X-Draft-Info']); + $draft_info = rcmail_sendmail::draftinfo_decode($args['message']->headers()['X-Draft-Info'] ?? ''); $draft_info['markdown_editor'] = 'yes'; $args['message']->headers(['X-Draft-Info' => rcmail_sendmail::draftinfo_encode($draft_info)], true); }