replace session return url by static pages

This commit is contained in:
Jonny Tischbein 2018-09-30 19:03:05 +02:00
parent e287991819
commit 0a699be3c0
2 changed files with 13 additions and 9 deletions

View File

@ -25,7 +25,7 @@ function follow_post(App $a)
$uid = local_user();
$url = notags(trim($_REQUEST['url']));
$return_url = $_SESSION['return_url'];
$return_url = 'contacts';
// Makes the connection request for friendica contacts easier
// This is just a precaution if maybe this page is called somewhere directly via POST
@ -39,7 +39,7 @@ function follow_post(App $a)
}
goaway($return_url);
} elseif ($result['cid']) {
goaway(System::baseUrl() . '/contacts/' . $result['cid']);
goaway('contacts/' . $result['cid']);
}
info(L10n::t('The contact could not be added.'));
@ -50,9 +50,11 @@ function follow_post(App $a)
function follow_content(App $a)
{
$return_url = 'contacts';
if (!local_user()) {
notice(L10n::t('Permission denied.'));
goaway($_SESSION['return_url']);
goaway($return_url);
// NOTREACHED
}
@ -116,7 +118,7 @@ function follow_content(App $a)
if (!$r) {
notice(L10n::t('Permission denied.'));
goaway($_SESSION['return_url']);
goaway($return_url);
// NOTREACHED
}

View File

@ -14,7 +14,7 @@ use Friendica\Model\User;
function unfollow_post()
{
$return_url = $_SESSION['return_url'];
$return_url = 'contacts';
if (!local_user()) {
notice(L10n::t('Permission denied.'));
@ -42,7 +42,7 @@ function unfollow_post()
if (!in_array($contact['network'], Protocol::NATIVE_SUPPORT)) {
notice(L10n::t('Unfollowing is currently not supported by your network.'));
goaway($return_url);
goaway($return_url.'/'.$contact['id']);
// NOTREACHED
}
@ -69,9 +69,11 @@ function unfollow_post()
function unfollow_content(App $a)
{
$return_url = 'contacts';
if (!local_user()) {
notice(L10n::t('Permission denied.'));
goaway($_SESSION['return_url']);
goaway($return_url);
// NOTREACHED
}
@ -86,7 +88,7 @@ function unfollow_content(App $a)
if (!DBA::isResult($contact)) {
notice(L10n::t("You aren't following this contact."));
goaway('contacts');
goaway($return_url);
// NOTREACHED
}
@ -103,7 +105,7 @@ function unfollow_content(App $a)
if (!DBA::isResult($self)) {
notice(L10n::t('Permission denied.'));
goaway($_SESSION['return_url']);
goaway($return_url);
// NOTREACHED
}