X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FProfile.php;h=9d1b002a7911ac5a53294b08f584e1853b69e02a;hb=71b1638d9a6cc44ab294116474c73c12d2df97f7;hp=c17be989402b37273ed9da8747c30564047cadea;hpb=cfa68c52b9117616fa95a4639ad74e7d220d193d;p=friendica.git diff --git a/src/Model/Profile.php b/src/Model/Profile.php index c17be98940..9d1b002a79 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -16,13 +16,14 @@ use Friendica\Core\PConfig; use Friendica\Core\System; use Friendica\Core\Worker; use Friendica\Database\DBA; +use Friendica\Model\Contact; use Friendica\Protocol\Diaspora; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; +use Friendica\Util\Proxy as ProxyUtils; use Friendica\Util\Temporal; require_once 'include/dba.php'; -require_once 'mod/proxy.php'; class Profile { @@ -115,6 +116,10 @@ class Profile return; } + if (empty($pdata)) { + $pdata = ['uid' => 0, 'profile_uid' => 0, 'is-default' => false,'name' => $nickname]; + } + // fetch user tags if this isn't the default profile if (!$pdata['is-default']) { @@ -340,14 +345,14 @@ class Profile "SELECT `url` FROM `contact` WHERE `uid` = %d AND `id` = '%s' AND `rel` = %d", intval($profile['uid']), intval(remote_user()), - intval(CONTACT_IS_FRIEND) + intval(Contact::FRIEND) ); } else { $r = q( "SELECT `url` FROM `contact` WHERE `uid` = %d AND `nurl` = '%s' AND `rel` = %d", intval($profile['uid']), - dbesc(normalise_link(self::getMyURL())), - intval(CONTACT_IS_FRIEND) + DBA::escape(normalise_link(self::getMyURL())), + intval(Contact::FRIEND) ); } if ($r) { @@ -463,9 +468,9 @@ class Profile AND NOT `hidden` AND NOT `archive` AND `network` IN ('%s', '%s', '%s', '')", intval($profile['uid']), - dbesc(NETWORK_DFRN), - dbesc(NETWORK_DIASPORA), - dbesc(NETWORK_OSTATUS) + DBA::escape(NETWORK_DFRN), + DBA::escape(NETWORK_DIASPORA), + DBA::escape(NETWORK_OSTATUS) ); if (DBA::isResult($r)) { $contacts = intval($r[0]['total']); @@ -490,7 +495,7 @@ class Profile } if (isset($p['photo'])) { - $p['photo'] = proxy_url($p['photo'], false, PROXY_SIZE_SMALL); + $p['photo'] = ProxyUtils::proxifyUrl($p['photo'], false, ProxyUtils::SIZE_SMALL); } $p['url'] = Contact::magicLink(defaults($p, 'url', $profile_url));