]> git.mxchange.org Git - friendica.git/blobdiff - mod/follow.php
Merge pull request #12025 from annando/no-boot-src-module
[friendica.git] / mod / follow.php
index b6ffe2ef0a9c45d48571250996919212b6b89d19..8e08d7a72ce0131b5f4417a7243be953a9543065 100644 (file)
@@ -23,6 +23,7 @@ use Friendica\App;
 use Friendica\Content\Widget;
 use Friendica\Core\Protocol;
 use Friendica\Core\Renderer;
+use Friendica\Core\Session;
 use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Model\Profile;
@@ -35,7 +36,7 @@ use Friendica\Util\Strings;
 
 function follow_post(App $a)
 {
-       if (!local_user()) {
+       if (!Session::getLocalUser()) {
                throw new \Friendica\Network\HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
        }
 
@@ -52,13 +53,13 @@ function follow_content(App $a)
 {
        $return_path = 'contact';
 
-       if (!local_user()) {
+       if (!Session::getLocalUser()) {
                DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
                DI::baseUrl()->redirect($return_path);
                // NOTREACHED
        }
 
-       $uid = local_user();
+       $uid = Session::getLocalUser();
 
        $url = Probe::cleanURI(trim($_REQUEST['url'] ?? ''));
 
@@ -195,7 +196,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, Session::getLocalUser());
        if (!$item_id) {
                // If the user-specific search failed, we search and probe a public post
                $item_id = Item::fetchByLink($url);