]> git.mxchange.org Git - friendica.git/blobdiff - mod/follow.php
Improved description
[friendica.git] / mod / follow.php
index b6ffe2ef0a9c45d48571250996919212b6b89d19..db7a52b2c32c5c9d088b4418775fa8d999be0aed 100644 (file)
@@ -35,7 +35,7 @@ use Friendica\Util\Strings;
 
 function follow_post(App $a)
 {
-       if (!local_user()) {
+       if (!DI::userSession()->getLocalUserId()) {
                throw new \Friendica\Network\HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
        }
 
@@ -52,13 +52,13 @@ function follow_content(App $a)
 {
        $return_path = 'contact';
 
-       if (!local_user()) {
+       if (!DI::userSession()->getLocalUserId()) {
                DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
                DI::baseUrl()->redirect($return_path);
                // NOTREACHED
        }
 
-       $uid = local_user();
+       $uid = DI::userSession()->getLocalUserId();
 
        $url = Probe::cleanURI(trim($_REQUEST['url'] ?? ''));
 
@@ -195,7 +195,7 @@ function follow_process(App $a, string $url)
 
 function follow_remote_item($url)
 {
-       $item_id = Item::fetchByLink($url, local_user());
+       $item_id = Item::fetchByLink($url, DI::userSession()->getLocalUserId());
        if (!$item_id) {
                // If the user-specific search failed, we search and probe a public post
                $item_id = Item::fetchByLink($url);