diff program/steps/mail/move_del.inc @ 27:c32b53434b47

more compensation for deprecated empty cases
author Charlie Root
date Sun, 18 Jan 2026 14:20:29 -0500
parents 4681f974d28b
children
line wrap: on
line diff
--- a/program/steps/mail/move_del.inc	Sat Oct 18 12:24:31 2025 -0400
+++ b/program/steps/mail/move_del.inc	Sun Jan 18 14:20:29 2026 -0500
@@ -27,9 +27,10 @@
 // count messages before changing anything
 $threading = (bool) $RCMAIL->storage->get_threading();
 $trash     = $RCMAIL->config->get('trash_mbox');
+$count     = 0;
 $sources   = array();
 
-if ($_POST['_from'] != 'show') {
+if (empty($_POST['_from']) || $_POST['_from'] != 'show') {
     $old_count = $RCMAIL->storage->count(NULL, $threading ? 'THREADS' : 'ALL');
     $old_pages = ceil($old_count / $RCMAIL->storage->get_pagesize());
 }
@@ -105,7 +106,7 @@
     $_SESSION['search'] = $RCMAIL->storage->refresh_search();
 }
 
-if ($_POST['_from'] == 'show') {
+if (!empty($_POST['_from']) && $_POST['_from'] == 'show') {
     if ($next = rcube_utils::get_input_value('_next_uid', rcube_utils::INPUT_GPC)) {
         $OUTPUT->command('show_message', $next);
     }
@@ -160,9 +161,9 @@
 }
 
 // add new rows from next page (if any)
-if ($addrows && $count && $uids != '*' && ($jump_back || $nextpage_count > 0)) {
+  if ($addrows && $count && $uids != '*' && (!empty($jump_back) || $nextpage_count > 0)) {
     // #5862: Don't add more rows than it was on the next page
-    $count = $jump_back ? null : min($nextpage_count, $count);
+    $count = !empty($jump_back) ? null : min($nextpage_count, $count);
 
     $a_headers = $RCMAIL->storage->list_messages($mbox, NULL,
         rcmail_sort_column(), rcmail_sort_order(), $count);