Skip to content

Commit

Permalink
Check for non-empty uid post parameters
Browse files Browse the repository at this point in the history
improve fix from commit 5b7e9a2
  • Loading branch information
thomascube committed Apr 17, 2018
1 parent c69b851 commit 7901047
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion plugins/archive/archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,10 @@ function move_messages()
$index = $storage->index(null, rcmail_sort_column(), rcmail_sort_order());
$messageset = array($current_mbox => $index->get());
}
else {
else if (!empty($uids)) {
$messageset = rcmail::get_uids($uids, $current_mbox);
} else {
$messageset = array();
}

foreach ($messageset as $mbox => $uids) {
Expand Down
9 changes: 6 additions & 3 deletions plugins/markasjunk/markasjunk.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,13 @@ function request_action()

$rcmail = rcmail::get_instance();
$storage = $rcmail->get_storage();
$uids = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_POST);

foreach (rcmail::get_uids(rcube_utils::get_input_value('_uid', rcube_utils::INPUT_POST)) as $mbox => $uids) {
$storage->unset_flag($uids, 'NONJUNK', $mbox);
$storage->set_flag($uids, 'JUNK', $mbox);
if (!empty($uids)) {
foreach (rcmail::get_uids($uids) as $mbox => $uids) {
$storage->unset_flag($uids, 'NONJUNK', $mbox);
$storage->set_flag($uids, 'JUNK', $mbox);
}
}

if (($junk_mbox = $rcmail->config->get('junk_mbox'))) {
Expand Down

0 comments on commit 7901047

Please sign in to comment.