]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Profile.php
New model class "host"
[friendica.git] / src / Model / Profile.php
index 2b1546db49ef077eee04f0e763bf4a4a2532859e..3cd3afe6cbea0f654bfad4648935522181d30df6 100644 (file)
@@ -166,7 +166,7 @@ class Profile
                        }
                }
 
-               $profile = self::getByNickname($nickname, $user['uid']);
+               $profile = User::getOwnerDataById($user['uid'], false);
 
                if (empty($profile) && empty($profiledata)) {
                        Logger::log('profile error: ' . DI::args()->getQueryString(), Logger::DEBUG);
@@ -258,7 +258,7 @@ class Profile
         * @hooks 'profile_sidebar'
         *      array $arr
         */
-       private static function sidebar(App $a, $profile, $block = 0, $show_connect = true)
+       private static function sidebar(App $a, array $profile, $block = 0, $show_connect = true)
        {
                $o = '';
                $location = false;
@@ -266,7 +266,8 @@ class Profile
                // This function can also use contact information in $profile
                $is_contact = !empty($profile['cid']);
 
-               if (!is_array($profile) && !count($profile)) {
+               if (empty($profile['nickname'])) {
+                       Logger::warning('Received profile with no nickname', ['profile' => $profile, 'callstack' => System::callstack(10)]);
                        return $o;
                }
 
@@ -291,8 +292,6 @@ class Profile
                $subscribe_feed_link = null;
                $wallmessage_link = null;
 
-
-
                $visitor_contact = [];
                if (!empty($profile['uid']) && self::getMyURL()) {
                        $visitor_contact = Contact::selectFirst(['rel'], ['uid' => $profile['uid'], 'nurl' => Strings::normaliseLink(self::getMyURL())]);
@@ -738,7 +737,7 @@ class Profile
                        $magic_path = $basepath . '/magic' . '?owa=1&dest=' . $dest . '&' . $addr_request;
 
                        // We have to check if the remote server does understand /magic without invoking something
-                       $serverret = Network::curl($basepath . '/magic');
+                       $serverret = DI::httpRequest()->get($basepath . '/magic');
                        if ($serverret->isSuccess()) {
                                Logger::log('Doing magic auth for visitor ' . $my_url . ' to ' . $magic_path, Logger::DEBUG);
                                System::externalRedirect($magic_path);