Aleksander Machniak
2013-04-05 d2d8d498c67e7193dcdcebe7d806753ec02843fd
Fix copying messages to a folder with "empty" name e.g. "0", better error handling
3 files modified
20 ■■■■■ changed files
program/steps/mail/copy.inc 8 ●●●● patch | view | raw | blame | history
program/steps/mail/mark.inc 10 ●●●● patch | view | raw | blame | history
program/steps/mail/move_del.inc 2 ●●●●● patch | view | raw | blame | history
program/steps/mail/copy.inc
@@ -24,10 +24,10 @@
  return;
// move messages
if (!empty($_POST['_uid']) && !empty($_POST['_target_mbox'])) {
    $uids = get_input_value('_uid', RCUBE_INPUT_POST);
if (!empty($_POST['_uid']) && strlen($_POST['_target_mbox'])) {
    $uids   = get_input_value('_uid', RCUBE_INPUT_POST);
    $target = get_input_value('_target_mbox', RCUBE_INPUT_POST, true);
    $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true);
    $mbox   = get_input_value('_mbox', RCUBE_INPUT_POST, true);
    $copied = $RCMAIL->storage->copy_message($uids, $target, $mbox);
@@ -47,7 +47,7 @@
}
// unknown action or missing query param
else {
    exit;
    $OUTPUT->show_message('internalerror', 'error');
}
// send response
program/steps/mail/mark.inc
@@ -113,7 +113,7 @@
      $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($msg_count), $mbox);
      if ($threading) {
        $count = get_input_value('_count', RCUBE_INPUT_POST);
        $count = get_input_value('_count', RCUBE_INPUT_POST);
      }
      // add new rows from next page (if any)
@@ -125,9 +125,9 @@
      }
    }
  }
  $OUTPUT->send();
}
else {
    $OUTPUT->show_message('internalerror', 'error');
}
exit;
$OUTPUT->send();
program/steps/mail/move_del.inc
@@ -73,6 +73,8 @@
}
// unknown action or missing query param
else {
    $OUTPUT->show_message('internalerror', 'error');
    $OUTPUT->send();
    exit;
}