Merge pull request #5861 from JonnyTischbein/issue_return_url

Replace goaway location SESSION var return_url with page as string value
This commit is contained in:
Hypolite Petovan 2018-10-09 14:46:14 -04:00 committed by GitHub
commit 257beec485
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 11 deletions

View File

@ -349,12 +349,12 @@ function drop_item($id)
// locate item to be deleted
$fields = ['id', 'uid', 'contact-id', 'deleted'];
$fields = ['id', 'uid', 'guid', 'contact-id', 'deleted'];
$item = Item::selectFirstForUser(local_user(), $fields, ['id' => $id]);
if (!DBA::isResult($item)) {
notice(L10n::t('Item not found.') . EOL);
goaway(System::baseUrl() . '/' . $_SESSION['return_url']);
goaway('/network');
}
if ($item['deleted']) {
@ -401,17 +401,17 @@ function drop_item($id)
}
// Now check how the user responded to the confirmation query
if (!empty($_REQUEST['canceled'])) {
goaway(System::baseUrl() . '/' . $_SESSION['return_url']);
goaway('/display/' . $item['guid']);
}
// delete the item
Item::deleteForUser(['id' => $item['id']], local_user());
goaway(System::baseUrl() . '/' . $_SESSION['return_url']);
goaway('/network');
//NOTREACHED
} else {
notice(L10n::t('Permission denied.') . EOL);
goaway(System::baseUrl() . '/' . $_SESSION['return_url']);
goaway('/display/' . $item['guid']);
//NOTREACHED
}
}

View File

@ -187,7 +187,7 @@ function events_post(App $a)
Worker::add(PRIORITY_HIGH, "Notifier", "event", $item_id);
}
goaway($_SESSION['return_url']);
goaway('/events');
}
function events_content(App $a)

View File

@ -25,9 +25,7 @@ function filerm_content(App $a) {
file_tag_unsave_file(local_user(),$item_id,$term, $category);
}
if (x($_SESSION,'return_url')) {
goaway(System::baseUrl() . '/' . $_SESSION['return_url']);
}
//goaway('/network');
killme();
}

View File

@ -15,7 +15,7 @@ function ostatus_subscribe_content(App $a) {
if (! local_user()) {
notice(L10n::t('Permission denied.') . EOL);
goaway($_SESSION['return_url']);
goaway('/ostatus_subscribe');
// NOTREACHED
}

View File

@ -14,7 +14,7 @@ function repair_ostatus_content(App $a) {
if (! local_user()) {
notice(L10n::t('Permission denied.') . EOL);
goaway($_SESSION['return_url']);
goaway('/ostatus_repair');
// NOTREACHED
}