]> git.mxchange.org Git - friendica.git/blobdiff - mod/unfollow.php
Merge pull request #9819 from annando/issue-9814
[friendica.git] / mod / unfollow.php
index d24745c8bb5efa584ad24999d40c541f08e7d593..54e015cf5272a25f1de02672ca1475c76140cf37 100644 (file)
@@ -37,7 +37,9 @@ function unfollow_post(App $a)
                // NOTREACHED
        }
 
-       unfollow_process();
+       $url = Strings::escapeTags(trim($_REQUEST['url'] ?? ''));
+
+       unfollow_process($url);
 }
 
 function unfollow_content(App $a)
@@ -50,10 +52,6 @@ function unfollow_content(App $a)
                // NOTREACHED
        }
 
-       if (!empty($_REQUEST['auto'])) {
-               unfollow_process();
-       }
-
        $uid = local_user();
        $url = Strings::escapeTags(trim($_REQUEST['url']));
 
@@ -89,6 +87,10 @@ function unfollow_content(App $a)
        // Makes the connection request for friendica contacts easier
        $_SESSION['fastlane'] = $contact['url'];
 
+       if (!empty($_REQUEST['auto'])) {
+               unfollow_process($contact['url']);
+       }
+
        $o = Renderer::replaceMacros($tpl, [
                '$header'        => DI::l10n()->t('Disconnect/Unfollow'),
                '$page_desc'     => '',
@@ -116,12 +118,11 @@ function unfollow_content(App $a)
        return $o;
 }
 
-function unfollow_process()
+function unfollow_process(string $url)
 {
        $base_return_path = 'contact';
 
        $uid = local_user();
-       $url = Strings::escapeTags(trim($_REQUEST['url'] ?? ''));
 
        $condition = ["`uid` = ? AND (`rel` = ? OR `rel` = ?) AND (`nurl` = ? OR `alias` = ? OR `alias` = ?)",
                $uid, Contact::SHARING, Contact::FRIEND, Strings::normaliseLink($url),