diff --git a/CHANGELOG.md b/CHANGELOG.md index 326e0cb98dd..90d09090ed1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ - Fix so vCard output does not contain non-standard/redundant TYPE=OTHER and TYPE=INTERNET (#8838) - Fix QR code images for contacts with non-ASCII characters (#9001) - Fix PHP8 warnings when using list_flags and list_cols properties by plugins (#8998) +- Fix bug where subfolders could loose subscription on parent folder rename (#8892) ## Release 1.6.1 diff --git a/program/actions/settings/folder_edit.php b/program/actions/settings/folder_edit.php index 2caebc36118..134ccc02e21 100644 --- a/program/actions/settings/folder_edit.php +++ b/program/actions/settings/folder_edit.php @@ -84,7 +84,7 @@ public static function folder_form($attrib) if (strlen($path)) { $path_id = $path; $path = $storage->mod_folder($path . $delimiter); - if ($path[strlen($path)-1] == $delimiter) { + if (($path[strlen($path)-1] ?? '') == $delimiter) { $path = substr($path, 0, -1); } } diff --git a/program/lib/Roundcube/rcube_imap.php b/program/lib/Roundcube/rcube_imap.php index aa4282a0422..addc2577bc3 100644 --- a/program/lib/Roundcube/rcube_imap.php +++ b/program/lib/Roundcube/rcube_imap.php @@ -3374,7 +3374,7 @@ public function rename_folder($folder, $new_name) // get list of subscribed folders if ((strpos($folder, '%') === false) && (strpos($folder, '*') === false)) { - $a_subscribed = $this->list_folders_subscribed('', $folder . $delm . '*'); + $a_subscribed = $this->list_folders_subscribed($folder . $delm, '*'); $subscribed = $this->folder_exists($folder, true); } else { @@ -3429,7 +3429,7 @@ public function delete_folder($folder) // get list of sub-folders or all folders // if folder name contains special characters $path = strpos($folder, '*') === false && strpos($folder, '%') === false ? ($folder . $delm) : ''; - $sub_mboxes = $this->list_folders('', $path . '*'); + $sub_mboxes = $this->list_folders($path, '*'); // According to RFC3501 deleting a \Noselect folder // with subfolders may fail. To workaround this we delete