]> git.mxchange.org Git - friendica.git/commitdiff
Empty the "remote" variable, avoid being remote to yourself
authorMichael <heluecht@pirati.ca>
Wed, 25 Sep 2019 07:02:07 +0000 (07:02 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 25 Sep 2019 07:02:07 +0000 (07:02 +0000)
src/Core/Session.php
src/Model/Profile.php

index cccd6951de06a6ec1b3549f4a0232da8fc3b0f26..9927fca189336f539bfc339f0e1b6222fa5326f3 100644 (file)
@@ -120,9 +120,10 @@ class Session
                        'my_url'        => $a->getBaseURL() . '/profile/' . $user_record['nickname'],
                        'my_address'    => $user_record['nickname'] . '@' . substr($a->getBaseURL(), strpos($a->getBaseURL(), '://') + 3),
                        'addr'          => defaults($_SERVER, 'REMOTE_ADDR', '0.0.0.0'),
+                       'remote'        => []
                ]);
 
-               $remote_contacts = DBA::select('contact', ['id', 'uid'], ['nurl' => Strings::normaliseLink($_SESSION['my_url']), 'rel' => [Contact::FOLLOWER, Contact::FRIEND]]);
+               $remote_contacts = DBA::select('contact', ['id', 'uid'], ['nurl' => Strings::normaliseLink($_SESSION['my_url']), 'rel' => [Contact::FOLLOWER, Contact::FRIEND], 'self' => false]);
                while ($contact = DBA::fetch($remote_contacts)) {
                        if (($contact['uid'] == 0) || Contact::isBlockedByUser($contact['id'], $contact['uid'])) {
                                continue;
index ab9b7fd00f50bb16ca280cc73fdafad9f83378b5..290b6d349018526de27774ffebd61ddcb82e1b02 100644 (file)
@@ -1124,7 +1124,7 @@ class Profile
                /// @todo replace this and the query for this variable with some cleaner functionality
                $_SESSION['remote'] = [];
 
-               $remote_contacts = DBA::select('contact', ['id', 'uid'], ['nurl' => $visitor['nurl'], 'rel' => [Contact::FOLLOWER, Contact::FRIEND]]);
+               $remote_contacts = DBA::select('contact', ['id', 'uid'], ['nurl' => $visitor['nurl'], 'rel' => [Contact::FOLLOWER, Contact::FRIEND], 'self' => false]);
                while ($contact = DBA::fetch($remote_contacts)) {
                        if (($contact['uid'] == 0) || Contact::isBlockedByUser($visitor['id'], $contact['uid'])) {
                                continue;