Skip to content

Commit

Permalink
making sure our redirects post-error go somewhere useful
Browse files Browse the repository at this point in the history
  • Loading branch information
caseysoftware committed Mar 13, 2014
1 parent 450da52 commit 6a25065
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/files/do_file_aed.php
Expand Up @@ -17,7 +17,7 @@
$isNotNew = (int) w2PgetParam($_POST, 'file_id', '0');
$cancel = (int) w2PgetParam($_POST, 'cancel', 0);
$duplicate = (int) w2PgetParam($_POST, 'duplicate', 0);
$redirect = w2PgetParam($_POST, 'redirect', '');
$redirect = w2PgetParam($_POST, 'redirect', 'm=files');
$notify = w2PgetParam($_POST, 'notify', '0');
$notify = ($notify != '0') ? '1' : '0';

Expand Down Expand Up @@ -70,7 +70,7 @@
$new_file->file_folder = 0;
if (!($dup_realname = $obj->duplicateFile($obj->file_project, $obj->file_real_filename))) {
$AppUI->setMsg('Could not duplicate file, check file permissions', UI_MSG_ERROR);
$AppUI->redirect();
$AppUI->redirect($redirect);
} else {
$new_file->file_real_filename = $dup_realname;
$result = $new_file->store();
Expand All @@ -90,7 +90,7 @@

if (count($obj->getError())) {
$AppUI->setMsg($obj->getError(), UI_MSG_ERROR);
$AppUI->redirect();
$AppUI->redirect($redirect);
}

if ($result) {
Expand Down

0 comments on commit 6a25065

Please sign in to comment.