From 825bcf5af70f072d5238f4eed95999b6016aa945 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Sun, 14 Aug 2022 15:27:09 +0200 Subject: Fix various "Creation of dynamic property is deprecated" warnings --- program/include/rcmail_sendmail.php | 38 ++++++++++++-------------- program/lib/Roundcube/rcube_message_header.php | 28 +++++++++++++++++++ program/lib/Roundcube/rcube_message_part.php | 14 ++++++++++ 3 files changed, 60 insertions(+), 20 deletions(-) diff --git a/program/include/rcmail_sendmail.php b/program/include/rcmail_sendmail.php index 209bcbd46..a8a9a34b8 100644 --- a/program/include/rcmail_sendmail.php +++ b/program/include/rcmail_sendmail.php @@ -973,7 +973,7 @@ class rcmail_sendmail } } - if (!empty($this->options['message']->identities)) { + if (!empty($this->data['identities'])) { $a_signatures = []; $identities = []; $top_posting = intval($this->rcmail->config->get('reply_mode')) > 0 @@ -987,7 +987,7 @@ class rcmail_sendmail $select_from = new html_select($field_attrib); // create SELECT element - foreach ($this->options['message']->identities as $sql_arr) { + foreach ($this->data['identities'] as $sql_arr) { $identity_id = $sql_arr['identity_id']; $select_from->add(format_email_recipient($sql_arr['email'], $sql_arr['name']), $identity_id); @@ -1024,7 +1024,7 @@ class rcmail_sendmail $identities[$identity_id]['email'] = $sql_arr['email']; } - $out = $select_from->show($this->options['message']->compose['from']); + $out = $select_from->show($this->data['from'] ?? null); // add signatures to client $this->rcmail->output->set_env('signatures', $a_signatures); @@ -1032,10 +1032,9 @@ class rcmail_sendmail } // no identities, display text input field else { - $from = $this->options['message']->compose['from'] ?? null; $field_attrib['class'] = 'from_address'; $input_from = new html_inputfield($field_attrib); - $out = $input_from->show($from); + $out = $input_from->show($this->data['from'] ?? null); } return $out; @@ -1107,11 +1106,11 @@ class rcmail_sendmail // Reply to message sent by yourself (#1487074, #1489230, #1490439) // Reply-To address need to be unset (#1490233) - if (!empty($message->compose['ident']) && empty($replyto)) { + if (!empty($this->data['ident']) && empty($replyto)) { foreach ([$fvalue, $message->get_header('from')] as $sender) { $senders = rcube_mime::decode_address_list($sender, null, false, $charset, true); - if (in_array($message->compose['ident']['email_ascii'], $senders)) { + if (in_array($this->data['ident']['email_ascii'], $senders)) { $fvalue = $message->headers->to; break; } @@ -1167,9 +1166,10 @@ class rcmail_sendmail // split recipients and put them back together in a unique way if (!empty($fvalue) && in_array($header, ['to', 'cc', 'bcc'])) { - $from_email = @mb_strtolower($message->compose['ident']['email']); + $from_email = !empty($this->data['ident']['email']) ? mb_strtolower($this->data['ident']['email']) : ''; $to_addresses = rcube_mime::decode_address_list($fvalue, null, $decode_header, $charset); $fvalue = []; + $recipients = []; foreach ($to_addresses as $addr_part) { if (empty($addr_part['mailto'])) { @@ -1183,14 +1183,14 @@ class rcmail_sendmail if ( ($header == 'to' || $mode != self::MODE_REPLY || $mailto_lc != $from_email) - && (empty($message->recipients) || !in_array($mailto_lc, (array) $message->recipients)) + && !in_array($mailto_lc, $recipients) ) { if ($addr_part['name'] && $mailto != $addr_part['name']) { $mailto = format_email_recipient($mailto, $addr_part['name']); } - $fvalue[] = $mailto; - $message->recipients[] = $mailto_lc; + $fvalue[] = $mailto; + $recipients[] = $mailto_lc; } } @@ -1529,23 +1529,21 @@ class rcmail_sendmail */ protected function compose_init($message) { - $message->compose = []; - // get user's identities - $message->identities = $this->rcmail->user->list_identities(null, true); + $this->data['identities'] = $this->rcmail->user->list_identities(null, true); // Set From field value if (!empty($_POST['_from'])) { - $message->compose['from'] = rcube_utils::get_input_string('_from', rcube_utils::INPUT_POST); + $this->data['from'] = rcube_utils::get_input_string('_from', rcube_utils::INPUT_POST); } else if (!empty($this->data['param']['from'])) { - $message->compose['from'] = $this->data['param']['from']; + $this->data['from'] = $this->data['param']['from']; } - else if (!empty($message->identities)) { - $ident = self::identity_select($message, $message->identities, $this->data['mode']); + else if (!empty($this->data['identities'])) { + $ident = self::identity_select($message, $this->data['identities'], $this->data['mode']); - $message->compose['from'] = $ident['identity_id']; - $message->compose['ident'] = $ident; + $this->data['from'] = $ident['identity_id']; + $this->data['ident'] = $ident; } $this->rcmail->output->add_handlers([ diff --git a/program/lib/Roundcube/rcube_message_header.php b/program/lib/Roundcube/rcube_message_header.php index fd434ec73..07c8a2346 100644 --- a/program/lib/Roundcube/rcube_message_header.php +++ b/program/lib/Roundcube/rcube_message_header.php @@ -138,6 +138,20 @@ class rcube_message_header */ public $bodystructure; + /** + * IMAP body (RFC822.TEXT) + * + * @var string + */ + public $body; + + /** + * IMAP part bodies + * + * @var array + */ + public $bodypart = []; + /** * IMAP internal date * @@ -229,6 +243,20 @@ class rcube_message_header */ public $parent_uid; + /** + * IMAP MODSEQ value + * + * @var int + */ + public $modseq; + + /** + * IMAP ENVELOPE + * + * @var string + */ + public $envelope; + /** * Header name to rcube_message_header object property map * diff --git a/program/lib/Roundcube/rcube_message_part.php b/program/lib/Roundcube/rcube_message_part.php index a291d864f..3f345f753 100644 --- a/program/lib/Roundcube/rcube_message_part.php +++ b/program/lib/Roundcube/rcube_message_part.php @@ -90,6 +90,20 @@ class rcube_message_part */ public $parts = []; + /** + * Part Content-Id + * + * @var string|null + */ + public $content_id; + + /** + * Part Content-Location + * + * @var string|null + */ + public $content_location; + public $type; public $replaces = []; public $disposition = ''; -- cgit v1.2.3