diff program/lib/Roundcube/rcube_imap.php @ 21:73124dd49283

More cleaning up php8 Warnings/deprecations, noticed that setting non-my-Dates mailboxes to sort on Date isn't sticky over ctrl-R
author Charlie Root
date Thu, 09 Oct 2025 11:31:41 -0400
parents b6a96bdd6b29
children 303b85d5b561
line wrap: on
line diff
--- a/program/lib/Roundcube/rcube_imap.php	Wed Oct 08 09:42:21 2025 -0400
+++ b/program/lib/Roundcube/rcube_imap.php	Thu Oct 09 11:31:41 2025 -0400
@@ -57,6 +57,7 @@
     protected $icache = array();
 
     protected $plugins;
+    protected $parts;
     protected $delimiter;
     protected $namespace;
     protected $sort_field = '';
@@ -1812,7 +1813,7 @@
             list($uid, $folder) = explode('-', $uid, 2);
         }
 
-        if (!strlen($folder)) {
+        if (empty($folder)) {
             $folder = $this->folder;
         }
 
@@ -1845,7 +1846,7 @@
      */
     public function get_message($uid, $folder = null)
     {
-        if (!strlen($folder)) {
+        if (!empty($folder)) {
             $folder = $this->folder;
         }
 
@@ -2028,7 +2029,7 @@
             // pre-fetch headers of all parts (in one command for better performance)
             // @TODO: we could do this before _structure_part() call, to fetch
             // headers for parts on all levels
-            if ($mime_part_headers) {
+            if (!empty($mime_part_headers)) {
                 $mime_part_headers = $this->conn->fetchMIMEHeaders($this->folder,
                     $this->msg_uid, $mime_part_headers);
             }
@@ -2040,7 +2041,7 @@
                 }
                 $tmp_part_id = $struct->mime_id ? $struct->mime_id.'.'.($i+1) : $i+1;
                 $struct->parts[] = $this->structure_part($part[$i], ++$count, $struct->mime_id,
-		 $mime_part_headers ? $mime_part_headers[$tmp_part_id] : null);
+							 empty($mime_part_headers[$tmp_part_id]) ? null : $mime_part_headers[$tmp_part_id]) ;
             }
 
             return $struct;
@@ -2144,7 +2145,7 @@
         }
 
         // fetch message headers if message/rfc822 or named part (could contain Content-Location header)
-        if ($struct->ctype_primary == 'message' || ($struct->ctype_parameters['name'] && !$struct->content_id)) {
+        if ($struct->ctype_primary == 'message' || (!empty($struct->ctype_parameters['name']) && !$struct->content_id)) {
             if (empty($mime_headers)) {
                 $mime_headers = $this->conn->fetchPartHeader(
                     $this->folder, $this->msg_uid, true, $struct->mime_id);