X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FProfile.php;h=cb2754cc80ce6a8ef218421ec7952ccb00327fed;hb=fa7cddc669036c2369103eefcc960d7b5343c9cd;hp=29bc7e680d1bbd3d7240c1af30de1997d6271575;hpb=3ea9b0680a0c8ff218ee42046405e6bc80c57719;p=friendica.git diff --git a/src/Model/Profile.php b/src/Model/Profile.php index 29bc7e680d..cb2754cc80 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -28,6 +28,19 @@ require_once 'include/dba.php'; class Profile { + /** + * @brief Returns default profile for a given user id + * + * @param integer User ID + * + * @return array Profile data + */ + public static function getByUID($uid) + { + $profile = DBA::selectFirst('profile', [], ['uid' => $uid, 'is-default' => true]); + return $profile; + } + /** * @brief Returns a formatted location string from the given profile array * @@ -361,7 +374,7 @@ class Profile if ($r) { $remote_url = $r[0]['url']; $message_path = preg_replace('=(.*)/profile/(.*)=ism', '$1/message/new/', $remote_url); - $wallmessage_link = $message_path . base64_encode($profile['addr']); + $wallmessage_link = $message_path . base64_encode(defaults($profile, 'addr', '')); } else if (!empty($profile['nickname'])) { $wallmessage_link = 'wallmessage/' . $profile['nickname']; }