Split goaway to System::externalRedirectTo() and App->internalRedirect()

This commit is contained in:
Philipp Holzer 2018-10-19 20:11:27 +02:00
commit d00ddc01af
No known key found for this signature in database
GPG key ID: 517BE60E2CE5C8A5
61 changed files with 286 additions and 266 deletions

View file

@ -18,7 +18,7 @@ function unfollow_post(App $a)
if (!local_user()) {
notice(L10n::t('Permission denied.'));
$a->redirect('login');
$a->internalRedirect('login');
// NOTREACHED
}
@ -32,17 +32,17 @@ function unfollow_post(App $a)
if (!DBA::isResult($contact)) {
notice(L10n::t("You aren't following this contact."));
$a->redirect($return_url);
$a->internalRedirect($return_url);
// NOTREACHED
}
if (!empty($_REQUEST['cancel'])) {
$a->redirect($return_url . '/' . $contact['id']);
$a->internalRedirect($return_url . '/' . $contact['id']);
}
if (!in_array($contact['network'], Protocol::NATIVE_SUPPORT)) {
notice(L10n::t('Unfollowing is currently not supported by your network.'));
$a->redirect($return_url . '/' . $contact['id']);
$a->internalRedirect($return_url . '/' . $contact['id']);
// NOTREACHED
}
@ -63,7 +63,7 @@ function unfollow_post(App $a)
}
info(L10n::t('Contact unfollowed'));
$a->redirect($return_path);
$a->internalRedirect($return_path);
// NOTREACHED
}
@ -73,7 +73,7 @@ function unfollow_content(App $a)
if (!local_user()) {
notice(L10n::t('Permission denied.'));
$a->redirect('login');
$a->internalRedirect('login');
// NOTREACHED
}
@ -88,13 +88,13 @@ function unfollow_content(App $a)
if (!DBA::isResult($contact)) {
notice(L10n::t("You aren't following this contact."));
$a->redirect($return_url);
$a->internalRedirect($return_url);
// NOTREACHED
}
if (!in_array($contact['network'], Protocol::NATIVE_SUPPORT)) {
notice(L10n::t('Unfollowing is currently not supported by your network.'));
$a->redirect('contact/' . $contact['id']);
$a->internalRedirect('contact/' . $contact['id']);
// NOTREACHED
}
@ -105,7 +105,7 @@ function unfollow_content(App $a)
if (!DBA::isResult($self)) {
notice(L10n::t('Permission denied.'));
$a->redirect($return_url);
$a->internalRedirect($return_url);
// NOTREACHED
}