]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Session.php
Added sharing check for DFRN
[friendica.git] / src / Core / Session.php
index c4fbb3f8c6d043b9764a0ef2623c64a92e2752d9..059cd499c080513d038e0329f1f929b82c59e7e4 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -44,6 +44,11 @@ class Session
                return DI::session()->get($name, $defaults);
        }
 
+       public static function pop($name, $defaults = null)
+       {
+               return DI::session()->pop($name, $defaults);
+       }
+
        public static function set($name, $value)
        {
                DI::session()->set($name, $value);
@@ -116,16 +121,17 @@ class Session
                $session = DI::session();
 
                $session->set('remote', []);
+               $remote = [];
 
                $remote_contacts = DBA::select('contact', ['id', 'uid'], ['nurl' => Strings::normaliseLink($session->get('my_url')), 'rel' => [Contact::FOLLOWER, Contact::FRIEND], 'self' => false]);
                while ($contact = DBA::fetch($remote_contacts)) {
                        if (($contact['uid'] == 0) || Contact\User::isBlocked($contact['id'], $contact['uid'])) {
                                continue;
                        }
-
-                       $session->set('remote', [$contact['uid'] => $contact['id']]);
+                       $remote[$contact['uid']] = $contact['id'];
                }
                DBA::close($remote_contacts);
+               $session->set('remote', $remote);
        }
 
        /**