Fix PHP warnings

This commit is contained in:
Aleksander Machniak
2026-02-08 09:31:53 +01:00
parent 8dac75abbd
commit 5096117c62

View File

@@ -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);
}