X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fcal.php;h=51a66613ee107221552cfd0ebae6964f1ac386f7;hb=c54a2c1e83822f6e043b449468570d2c9ed3ab3a;hp=4a6e2c992881155059272a09d9b9bd8eea2b29b1;hpb=390d5706f46ce58cbed24b292d5c1f1b9789a8a8;p=friendica.git diff --git a/mod/cal.php b/mod/cal.php index 4a6e2c9928..51a66613ee 100644 --- a/mod/cal.php +++ b/mod/cal.php @@ -6,10 +6,10 @@ * This calendar is for profile visitors and contains only the events * of the profile owner */ + use Friendica\App; use Friendica\Content\Feature; use Friendica\Core\Config; -use Friendica\Core\PConfig; use Friendica\Core\System; use Friendica\Database\DBM; use Friendica\Model\Contact; @@ -32,16 +32,13 @@ function cal_init(App $a) if ($a->argc > 1) { $nick = $a->argv[1]; - $user = q("SELECT * FROM `user` WHERE `nickname` = '%s' AND `blocked` = 0 LIMIT 1", - dbesc($nick) - ); - - if (!count($user)) { + $user = dba::selectFirst('user', [], ['nickname' => $nick, 'blocked' => false]); + if (!DBM::is_result($user)) { return; } - $a->data['user'] = $user[0]; - $a->profile_uid = $user[0]['uid']; + $a->data['user'] = $user; + $a->profile_uid = $user['uid']; // if it's a json request abort here becaus we don't // need the widget data