]> git.mxchange.org Git - friendica.git/commitdiff
Use the uid for the owner cache
authorMichael Vogel <icarus@dabo.de>
Sun, 16 Aug 2020 12:51:15 +0000 (14:51 +0200)
committerMichael Vogel <icarus@dabo.de>
Sun, 16 Aug 2020 12:51:15 +0000 (14:51 +0200)
src/Model/User.php

index 8730fa8c9accbda4cf5c6467b4ef89f4654348f3..f821cd71d62a847a546f58f467394b985051f25a 100644 (file)
@@ -213,10 +213,10 @@ class User
         * @return boolean|array
         * @throws Exception
         */
-       public static function getOwnerDataById($uid, $check_valid = true)
+       public static function getOwnerDataById(int $uid, bool $check_valid = true)
        {
-               if (!empty(self::$owner)) {
-                       return self::$owner;
+               if (!empty(self::$owner[$uid])) {
+                       return self::$owner[$uid];
                }
 
                $owner = DBA::selectFirst('owner-view', [], ['uid' => $uid]);
@@ -262,7 +262,7 @@ class User
                        $owner = self::getOwnerDataById($uid, false);
                }
 
-               self::$owner = $owner;
+               self::$owner[$uid] = $owner;
                return $owner;
        }