X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Funfollow.php;h=aca17727b6950627791cd742daad45352f592047;hb=a0772c91d09b67701436da854235610da7f7e37d;hp=d24745c8bb5efa584ad24999d40c541f08e7d593;hpb=33575a94fa009c479e6c9eb330fad317e5c92d2f;p=friendica.git diff --git a/mod/unfollow.php b/mod/unfollow.php index d24745c8bb..aca17727b6 100644 --- a/mod/unfollow.php +++ b/mod/unfollow.php @@ -1,6 +1,6 @@ t("You aren't following this contact.")); @@ -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' => '', @@ -97,7 +99,7 @@ function unfollow_content(App $a) '$submit' => DI::l10n()->t('Submit Request'), '$cancel' => DI::l10n()->t('Cancel'), '$url' => $contact['url'], - '$zrl' => Contact::magicLink($contact['url']), + '$zrl' => Contact::magicLinkByContact($contact), '$url_label' => DI::l10n()->t('Profile URL'), '$myaddr' => $self['url'], '$request' => $request, @@ -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), @@ -157,4 +158,4 @@ function unfollow_process() } DI::baseUrl()->redirect($return_path); -} \ No newline at end of file +}