]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/Security.php
Fix "redir" loop
[friendica.git] / src / Util / Security.php
index 1c934d6fe617c741d9d6b47316570ea2ebe7b74b..0c09b745d8ea1f862de7e153eae1b24816a1cc62 100644 (file)
@@ -33,7 +33,7 @@ class Security extends BaseObject
                        return true;
                }
 
-               if (remote_user()) {
+               if (remote_user($owner)) {
                        // use remembered decision and avoid a DB lookup for each and every display item
                        // DO NOT use this function if there are going to be multiple owners
                        // We have a contact-id for an authenticated remote user, this block determines if the contact
@@ -44,17 +44,7 @@ class Security extends BaseObject
                        } elseif ($verified === 1) {
                                return false;
                        } else {
-                               $cid = 0;
-
-                               if (!empty($_SESSION['remote'])) {
-                                       foreach ($_SESSION['remote'] as $visitor) {
-                                               if ($visitor['uid'] == $owner) {
-                                                       $cid = $visitor['cid'];
-                                                       break;
-                                               }
-                                       }
-                               }
-
+                               $cid = remote_user($owner);
                                if (!$cid) {
                                        return false;
                                }