Mercurial > hg > rc2
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 21:73124dd49283 | 22:303b85d5b561 |
|---|---|
| 103 | 103 |
| 104 // start session | 104 // start session |
| 105 $this->session_init(); | 105 $this->session_init(); |
| 106 | 106 |
| 107 // create user object | 107 // create user object |
| 108 $this->set_user(new rcube_user($_SESSION['user_id'])); | 108 $this->set_user(new rcube_user($_SESSION['user_id']??null)); |
| 109 | 109 |
| 110 // set task and action properties | 110 // set task and action properties |
| 111 $this->set_task(rcube_utils::get_input_value('_task', rcube_utils::INPUT_GPC)); | 111 $this->set_task(rcube_utils::get_input_value('_task', rcube_utils::INPUT_GPC)); |
| 112 $this->action = asciiwords(rcube_utils::get_input_value('_action', rcube_utils::INPUT_GPC)); | 112 $this->action = asciiwords(rcube_utils::get_input_value('_action', rcube_utils::INPUT_GPC)); |
| 113 | 113 |
| 114 // reset some session parameters when changing task | 114 // reset some session parameters when changing task |
| 115 if ($this->task != 'utils') { | 115 if ($this->task != 'utils') { |
| 116 // we reset list page when switching to another task | 116 // we reset list page when switching to another task |
| 117 // but only to the main task interface - empty action (#1489076, #1490116) | 117 // but only to the main task interface - empty action (#1489076, #1490116) |
| 118 // this will prevent from unintentional page reset on cross-task requests | 118 // this will prevent from unintentional page reset on cross-task requests |
| 119 if ($this->session && $_SESSION['task'] != $this->task && empty($this->action)) { | 119 if ($this->session && ($_SESSION['task']??null) != $this->task && empty($this->action)) { |
| 120 $this->session->remove('page'); | 120 $this->session->remove('page'); |
| 121 | 121 |
| 122 // set current task to session | 122 // set current task to session |
| 123 $_SESSION['task'] = $this->task; | 123 $_SESSION['task'] = $this->task; |
| 124 } | 124 } |
| 481 public function session_init() | 481 public function session_init() |
| 482 { | 482 { |
| 483 parent::session_init(); | 483 parent::session_init(); |
| 484 | 484 |
| 485 // set initial session vars | 485 // set initial session vars |
| 486 if (!$_SESSION['user_id']) { | 486 if (empty($_SESSION['user_id'])) { |
| 487 $_SESSION['temp'] = true; | 487 $_SESSION['temp'] = true; |
| 488 } | 488 } |
| 489 | 489 |
| 490 // restore skin selection after logout | 490 // restore skin selection after logout |
| 491 if (!empty($_SESSION['temp']) && !empty($_SESSION['skin'])) { | 491 if (!empty($_SESSION['temp']) && !empty($_SESSION['skin'])) { |
| 966 * @param rcube_user $user User object | 966 * @param rcube_user $user User object |
| 967 */ | 967 */ |
| 968 private function fix_namespace_settings($user) | 968 private function fix_namespace_settings($user) |
| 969 { | 969 { |
| 970 $prefix = $this->storage->get_namespace('prefix'); | 970 $prefix = $this->storage->get_namespace('prefix'); |
| 971 $prefix_len = strlen($prefix); | 971 |
| 972 | 972 if (empty($prefix)) { |
| 973 if (!$prefix_len) { | |
| 974 return; | 973 return; |
| 975 } | 974 } |
| 976 | 975 |
| 977 if ($this->config->get('namespace_fixed')) { | 976 if ($this->config->get('namespace_fixed')) { |
| 978 return; | 977 return; |
