]> git.mxchange.org Git - friendica.git/blobdiff - mod/follow.php
Avoid a notice
[friendica.git] / mod / follow.php
index ef2325ad03d3d7ae0a599297ca525373f08057a1..04c279c5b6ab707f5995aa0c229e412613082d50 100644 (file)
@@ -16,18 +16,16 @@ use Friendica\Util\Proxy as ProxyUtils;
 function follow_post(App $a)
 {
        if (!local_user()) {
-               notice(L10n::t('Permission denied.'));
-               goaway($_SESSION['return_url']);
-               // NOTREACHED
+               System::httpExit(403, ['title' => L10n::t('Access denied.')]);
        }
 
        if (isset($_REQUEST['cancel'])) {
-               goaway($_SESSION['return_url']);
+               goaway('contacts');
        }
 
        $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
@@ -41,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.'));
@@ -52,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
        }
 
@@ -118,7 +118,7 @@ function follow_content(App $a)
 
        if (!$r) {
                notice(L10n::t('Permission denied.'));
-               goaway($_SESSION['return_url']);
+               goaway($return_url);
                // NOTREACHED
        }