Code Standards + return path for \!local_user() and cancel

This commit is contained in:
Jonny Tischbein 2018-10-02 18:13:58 +02:00
parent 9915523490
commit fa3bbc5f45
2 changed files with 12 additions and 12 deletions

View file

@ -18,14 +18,10 @@ function unfollow_post()
if (!local_user()) {
notice(L10n::t('Permission denied.'));
goaway($return_url);
goaway('/login');
// NOTREACHED
}
if (!empty($_REQUEST['cancel'])) {
goaway($return_url);
}
$uid = local_user();
$url = notags(trim(defaults($_REQUEST, 'url', '')));
@ -40,9 +36,13 @@ function unfollow_post()
// NOTREACHED
}
if (!empty($_REQUEST['cancel'])) {
goaway($return_url . '/' . $contact['id']);
}
if (!in_array($contact['network'], Protocol::NATIVE_SUPPORT)) {
notice(L10n::t('Unfollowing is currently not supported by your network.'));
goaway($return_url.'/'.$contact['id']);
goaway($return_url . '/' . $contact['id']);
// NOTREACHED
}
@ -73,7 +73,7 @@ function unfollow_content(App $a)
if (!local_user()) {
notice(L10n::t('Permission denied.'));
goaway($return_url);
goaway('/login');
// NOTREACHED
}