-if ($_action=='moveto' && $_GET['_uid'] && $_GET['_target_mbox'])
- {
- $count = sizeof(explode(',', $_GET['_uid']));
- $moved = $IMAP->move_message($_GET['_uid'], $_GET['_target_mbox'], $_GET['_mbox']);
-
- if (!$moved)
- {
- // send error message
- $commands = "this.list_mailbox();\n";
- $commands .= show_message('errormoving', 'error');
- rcube_remote_response($commands);
- exit;
+if ($RCMAIL->action=='moveto' && !empty($_POST['_uid']) && strlen($_POST['_target_mbox'])) {
+ $count = sizeof(explode(',', ($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);
+
+ $moved = $IMAP->move_message($uids, $target, $mbox);
+
+ if (!$moved) {
+ // send error message
+ if ($_POST['_from'] != 'show')
+ $OUTPUT->command('list_mailbox');
+ rcmail_display_server_error('errormoving');
+ $OUTPUT->send();
+ exit;
+ }
+ else {
+ $OUTPUT->show_message('messagemoved', 'confirmation');