]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Session.php
Allow nullable UID in PConfigCache
[friendica.git] / src / Core / Session.php
index e3768cbef135834f3a5c1187fd5a121e60511316..e54c0e49b910f413b67e3190f1f17991a25f1499 100644 (file)
@@ -62,13 +62,7 @@ class Session
         */
        public static function get($name, $defaults = null)
        {
-               if (isset($_SESSION)) {
-                       $return = defaults($_SESSION, $name, $defaults);
-               } else {
-                       $return = $defaults;
-               }
-
-               return $return;
+               return $_SESSION[$name] ?? $defaults;
        }
 
        /**
@@ -155,7 +149,7 @@ class Session
                        $a->getLogger()->info('auth_identities refresh: ' . print_r($a->identities, true));
                }
 
-               $contact = Contact::select([], ['uid' => $user_record['uid'], 'self' => true]);
+               $contact = DBA::selectFirst('contact', [], ['uid' => $user_record['uid'], 'self' => true]);
                if (DBA::isResult($contact)) {
                        $a->contact = $contact;
                        $a->cid = $contact['id'];