diff program/include/rcmail.php @ 22:303b85d5b561

More cleaning up php8 Warnings/deprecations
author Charlie Root
date Wed, 15 Oct 2025 14:06:27 -0400
parents 73124dd49283
children c32b53434b47
line wrap: on
line diff
--- a/program/include/rcmail.php	Thu Oct 09 11:31:41 2025 -0400
+++ b/program/include/rcmail.php	Wed Oct 15 14:06:27 2025 -0400
@@ -105,7 +105,7 @@
         $this->session_init();
 
         // create user object
-        $this->set_user(new rcube_user($_SESSION['user_id']));
+        $this->set_user(new rcube_user($_SESSION['user_id']??null));
 
         // set task and action properties
         $this->set_task(rcube_utils::get_input_value('_task', rcube_utils::INPUT_GPC));
@@ -116,7 +116,7 @@
             // we reset list page when switching to another task
             // but only to the main task interface - empty action (#1489076, #1490116)
             // this will prevent from unintentional page reset on cross-task requests
-            if ($this->session && $_SESSION['task'] != $this->task && empty($this->action)) {
+	  if ($this->session && ($_SESSION['task']??null) != $this->task && empty($this->action)) {
                 $this->session->remove('page');
 
                 // set current task to session
@@ -483,7 +483,7 @@
         parent::session_init();
 
         // set initial session vars
-        if (!$_SESSION['user_id']) {
+        if (empty($_SESSION['user_id'])) {
             $_SESSION['temp'] = true;
         }
 
@@ -968,9 +968,8 @@
     private function fix_namespace_settings($user)
     {
         $prefix     = $this->storage->get_namespace('prefix');
-        $prefix_len = strlen($prefix);
 
-        if (!$prefix_len) {
+        if (empty($prefix)) {
             return;
         }